original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Returns the value of the path segment for the index specified or null if not found.
  
  @param int $index the index of the path segment.
  @return string|null The value of the path segment for the index specified or null if not found.
docstring_tokens: Returns the value of the path segment for the index specified or null if not found .