3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $code = '<?php "${*/phpinfo()}";phpinfo()}";'; $tokens = token_get_all($code); foreach ($tokens as $token) { if (is_array($token)) { echo (token_name($token[0]) . ': ' . $token[1] . ' <br /> '); } else { echo ('' . $token . ' <br /> '); } }
Output for 4.3.2 - 7.1.0
T_OPEN_TAG: <?php <br /> " <br /> T_DOLLAR_OPEN_CURLY_BRACES: ${ <br /> * <br /> / <br /> T_STRING: phpinfo <br /> ( <br /> ) <br /> } <br /> " <br /> ; <br /> T_STRING: phpinfo <br /> ( <br /> ) <br /> } <br /> " <br /> T_ENCAPSED_AND_WHITESPACE: ; <br />
Output for 4.3.0 - 4.3.1
T_OPEN_TAG: <?php <br /> " <br /> T_DOLLAR_OPEN_CURLY_BRACES: ${ <br /> * <br /> / <br /> T_STRING: phpinfo <br /> ( <br /> ) <br /> } <br /> " <br /> ; <br /> T_STRING: phpinfo <br /> ( <br /> ) <br /> } <br /> " <br /> T_STRING: ; <br />