public function matchingFirstSegments(Path $anotherPath) {
		$segments = $anotherPath->segments();
		$count = 0;
		foreach ($this->segments as $i => $segment) {
			if ($segment != $segments[$i]) {
				break;
			}
			$count++;
		}
		
		return $count;
	}
public function matchingFirstSegments(Path $anotherPath) {
		$segments = $anotherPath->segments();
		$count = 0;
		foreach ($this->segments as $i => $segment) {
			if ($segment != $segments[$i]) {
				break;
			}
			$count++;
		}
		
		return $count;
	}
public function matchingFirstSegments ( Path $ anotherPath ) { $ segments = $ anotherPath -> segments ( ) ; $ count = 0 ; foreach ( $ this -> segments as $ i => $ segment ) { if ( $ segment != $ segments [ $ i ] ) { break ; } $ count ++ ; } return $ count ; }
Returns a count of the number of segments which match in this
path and the given path, comparing in increasing segment number order.

@param Path $anotherPath
@return int
Returns a count of the number of segments which match in this path and the given path comparing in increasing segment number order .