3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tokens = token_get_all('<?php $a = "${phpinfo()}";'); foreach ($tokens as $token) { if (is_array($token)) echo (token_name($token[0]) . ': "' . $token[1] . '"'."\n"); else echo ('"' . $token . '"'."\n"); }
Output for 5.5.24 - 7.1.0
T_OPEN_TAG: "<?php " T_VARIABLE: "$a" T_WHITESPACE: " " "=" T_WHITESPACE: " " """ T_DOLLAR_OPEN_CURLY_BRACES: "${" T_STRING: "phpinfo" "(" ")" "}" """ ";"
Output for 4.3.0 - 5.4.45
T_OPEN_TAG: "<?php " T_VARIABLE: "$a" T_WHITESPACE: " " "=" T_WHITESPACE: " " """ T_DOLLAR_OPEN_CURLY_BRACES: "${" T_STRING_VARNAME: "phpinfo" "(" ")" "}" """ ";"