Returns the specified segment of this path, or null if the path does not have such a segment.

@param int $index
@return string
508272
public function segment($index) {
		if (isset($this->segments[$index])) {
			return $this->segments[$index];
		}

		return null;
	}
489460
public function getHref($index=null, $separator="/") {
		if (!isset($index)) {
			$index=sizeof($this->content);
		}
		if ($this->absolutePaths === true) {
			return $this->_hrefFunction($this->content[$index]);
		} else {
			return $this->root . implode($separator, array_slice(array_map(function ($e) {
				return $this->_hrefFunction($e);
			}, $this->content), $this->startIndex, $index + 1));
		}
	}
241679
private function getByIndex($index)
    {
        if (!isset($this->headers[$index])) {
            return null;
        }
        if ($this->headerObjects[$index] === null) {
            $this->headerObjects[$index] = $this->headerFactory->newInstance(
                $this->headers[$index][0],
                $this->headers[$index][1]
            );
        }
        return $this->headerObjects[$index];
    }
63834
public function offsetGet($index)
    {
        return isset($this->rows[$index]) ? $this->rows[$index] : null;
    }
568117
public function segment($index, $default = null)
    {
        return array_key_exists($index, $this->segments()) ? $this->segments()[$index] : $default;
    }
517531
public function getSegment($index): ?string
    {
        $path = trim($this->path, '/');
        if (isset($path{0})) {
            $parts = explode('/', $path);
            if (array_key_exists($index, $parts)) {
                return $parts[$index];
            }
        }
        return null;
    }
1281239
public static function getPathSegment(int $index = 0)
    {
        $pathComponents = self::getPathSegments();
        return ArrayUtils::getArrayValueForKeyOrDefault($pathComponents, $index, false);
    }
1206736
public static function getByName(String $get, $index = NULL) : String
    {
        $segArr = self::segmentArray();
        
        $getVal = (int) array_search($get, $segArr);

        if( $index === 'all' )
        {
            $indexVal = count($segArr) - 1;
        }
        else
        {
            $indexVal = array_search($index, $segArr);
        }

        $return = '';

        for( $i = $getVal; $i <= $indexVal; $i++ )
        {
            $return .= $segArr[$i]."/";
        }

        return substr($return, 0, -1);
    }
706775
public function segment($delimiter, $index) {
        $parts = $this->split($delimiter);
        $returnValue = (isset($parts[$index - 1])) ? $parts[$index - 1] : '';

        return $this->createClone($returnValue);
    }
176897
protected function getValue($index)
    {
        if ($this->values[$index] === null) {
            return null;
        }
        return $this->values[$index]->value;
    }
64002
public function get(int $index): ?int {
        if (isset($this->array[$index])) {
            return $this->array[$index];
        }
        return null;
    }
1304453
public function getSearchIndex($index)
    {
        return isset($this->search[$index]) ? $this->search[$index] : null;
    }
464530
protected function getMethodParam($index)
    {
        if (isset($this->methodParams[$index]) && ($value = intval($this->methodParams[$index])) > 0) {
            return $value;
        }

        return null;
    }
509371
public function getIndexUrl($index)
    {
        $oParam = (int) $this->current()->query->getValue('o') + $index;
        $newQuery = new MergeQuery('o='.$oParam);

        return $newQuery($this->url);
    }
198471
public function atIndex(int $index)
    {
        $i = 0;
        foreach ($this->items as $key => $value) {
            if ($i++ == $index) {
                return $value;
            }
        }

        return null;
    }
476104
public function get_element($index)
    {
        $count = $this->count();

        if (!$count) {
            return null;
        }

        // first element
        if ($index === 0 || $index === '0' || $index === 'FIRST') {
            $pos = strpos($this->raw_data, self::SEPARATOR_ELEMENT);
            if ($pos === false)
                $result = (int) $this->raw_data;
            else
                $result = (int) substr($this->raw_data, 0, $pos);

            return $result;
        }

        // last element
        if ($index === 'LAST' || $index == $count-1) {
            $pos = strrpos($this->raw_data, self::SEPARATOR_ELEMENT);
            if ($pos === false)
                $result = (int) $this->raw_data;
            else
                $result = (int) substr($this->raw_data, $pos);

            return $result;
        }

        // do we know the position of the element or the neighbour of it?
        if (!empty($this->meta['pos'])) {
            if (isset($this->meta['pos'][$index]))
                $pos = $this->meta['pos'][$index];
            else if (isset($this->meta['pos'][$index-1]))
                $pos = strpos($this->raw_data, self::SEPARATOR_ELEMENT,
                    $this->meta['pos'][$index-1] + 1);
            else if (isset($this->meta['pos'][$index+1]))
                $pos = strrpos($this->raw_data, self::SEPARATOR_ELEMENT,
                    $this->meta['pos'][$index+1] - $this->length() - 1);

            if (isset($pos) && preg_match('/([0-9]+)/', $this->raw_data, $m, null, $pos)) {
                return (int) $m[1];
            }
        }

        // Finally use less effective method
        $data = explode(self::SEPARATOR_ELEMENT, $this->raw_data);

        return $data[$index];
    }
31895
public function Item( $index )
	{
		if ( $this->getCount() <= $index && ! $this->_done )
		{
			$count = $this->getCount();
			while ( ! $this->_done && ( $count <= $index))
			{
				if ( $this->_iter->MoveNext() )
				{
					/**
					 * @var XmlNode $node
					 */
					$node = $this->GetNode( $this->_iter->getCurrent() );
					if ( ! is_null( $node ) )
					{
						$this->_list[] = $node;
						$count++;
					}
				}
				else
					$this->_done = true;
			}
		}
		if ( $index >= 0 && count( $this->_list ) > $index )
			return $this->_list[ $index ];
		return null;
	}