Example #1
0
 public function sub($path)
 {
     $base = new self(strval($path));
     $sub = new self();
     $a = $this->getSegments();
     $b = $base->getSegments();
     $s = array();
     $i = 0;
     while (isset($a[$i]) && isset($b[$i]) && $a[$i] == $b[$i]) {
         $sub->setAbsolute(false);
         $i++;
     }
     $sub->setSegments(\array_slice($a, $i));
     if ($i) {
         $sub->setAbsolute(false);
     }
     $sub->setClosed($this->isClosed());
     return $sub;
 }