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
Saved

Saved

gtsolutions 373

gtsolutions
published 4 years ago

<pre>
    <?php
    /*
     * 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 />";
    ?>
</pre>
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).