private static function lexNumber(string $number, array &$tokens, int &$cursor): void
    {
        $floatVal = (float)$number;
        $intVal = (int)$number;

        // Determine if this was a float or not
        if ($floatVal && $intVal != $floatVal) {
            $tokens[] = new Token(TokenTypes::T_NUMBER, $floatVal);
        } else {
            $tokens[] = new Token(TokenTypes::T_NUMBER, $intVal);
        }

        $cursor += \mb_strlen($number);
    }
private static function lexNumber(string $number, array &$tokens, int &$cursor): void
    {
        $floatVal = (float)$number;
        $intVal = (int)$number;

        // Determine if this was a float or not
        if ($floatVal && $intVal != $floatVal) {
            $tokens[] = new Token(TokenTypes::T_NUMBER, $floatVal);
        } else {
            $tokens[] = new Token(TokenTypes::T_NUMBER, $intVal);
        }

        $cursor += \mb_strlen($number);
    }
private static function lexNumber ( string $ number , array & $ tokens , int & $ cursor ) : void { $ floatVal = ( float ) $ number ; $ intVal = ( int ) $ number ; // Determine if this was a float or not if ( $ floatVal && $ intVal != $ floatVal ) { $ tokens [ ] = new Token ( TokenTypes :: T_NUMBER , $ floatVal ) ; } else { $ tokens [ ] = new Token ( TokenTypes :: T_NUMBER , $ intVal ) ; } $ cursor += \ mb_strlen ( $ number ) ; }
Lexes a number lexeme

@param string $number The lexeme to add
@param Token[] $tokens The list of tokens to add to
@param int $cursor The current cursor
Lexes a number lexeme