private function point()
    {
        // Get first coordinate value
        $x = $this->coordinate();

        // If no additional tokens return single coordinate
        if (null === $this->lexer->lookahead) {
            return $x;
        }

        // Coordinate pairs may be separated by a comma
        if ($this->lexer->isNextToken(Lexer::T_COMMA)) {
            $this->match(Lexer::T_COMMA);
        }

        // Get second coordinate value
        $y = $this->coordinate();

        // There should be no additional tokens
        if (null !== $this->lexer->lookahead) {
            throw $this->syntaxError('end of string');
        }

        // Return coordinate array
        return array($x, $y);
    }
private function point()
    {
        // Get first coordinate value
        $x = $this->coordinate();

        // If no additional tokens return single coordinate
        if (null === $this->lexer->lookahead) {
            return $x;
        }

        // Coordinate pairs may be separated by a comma
        if ($this->lexer->isNextToken(Lexer::T_COMMA)) {
            $this->match(Lexer::T_COMMA);
        }

        // Get second coordinate value
        $y = $this->coordinate();

        // There should be no additional tokens
        if (null !== $this->lexer->lookahead) {
            throw $this->syntaxError('end of string');
        }

        // Return coordinate array
        return array($x, $y);
    }
private function point ( ) { // Get first coordinate value $ x = $ this -> coordinate ( ) ; // If no additional tokens return single coordinate if ( null === $ this -> lexer -> lookahead ) { return $ x ; } // Coordinate pairs may be separated by a comma if ( $ this -> lexer -> isNextToken ( Lexer :: T_COMMA ) ) { $ this -> match ( Lexer :: T_COMMA ) ; } // Get second coordinate value $ y = $ this -> coordinate ( ) ; // There should be no additional tokens if ( null !== $ this -> lexer -> lookahead ) { throw $ this -> syntaxError ( 'end of string' ) ; } // Return coordinate array return array ( $ x , $ y ) ; }
Match and return single value or pair

@return float|int|array
@throws UnexpectedValueException
Match and return single value or pair