Speed up development with full-stack environments for every branch.

Learn More

How to use token_name with PHP Tokenizer [token_name()]

Forked from How to use token_get_all with PHP Tokenizer.

50 Runs 140 Views 23 Copies


gtsolutions 373

published 4 years ago

     * PHP Tokenizer - token_name
     * token_name() gets the symbolic name for a PHP token value. 

    // 260 is the token value for the T_EVAL token
    echo "The token value for 260 is : " . token_name(260) . "<br />";
    // a token constant maps to its own name
    echo "The token value for 'T_FUNCTION' is : " . token_name(T_FUNCTION) . "<br />";
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).