public function upToSegment($count) {
		$segments = new ArrayObject();
		for ($i = 0; $i < $count; $i++) {
			$segments->push($this->segments[$i]);
		}

		return new Path($segments->join('/'));
	}
public function upToSegment($count) {
		$segments = new ArrayObject();
		for ($i = 0; $i < $count; $i++) {
			$segments->push($this->segments[$i]);
		}

		return new Path($segments->join('/'));
	}
public function upToSegment ( $ count ) { $ segments = new ArrayObject ( ) ; for ( $ i = 0 ; $ i < $ count ; $ i ++ ) { $ segments -> push ( $ this -> segments [ $ i ] ) ; } return new Path ( $ segments -> join ( '/' ) ) ; }
Returns a copy of this path truncated after the given number of segments.

@param int $count
@return Path
Returns a copy of this path truncated after the given number of segments .