3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $code = '<?php "${?><?php //"'; $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.4.3 - 4.4.9, 5.1.3 - 5.1.4, 5.1.6 - 7.1.0
T_OPEN_TAG: <?php <br /> " <br /> T_DOLLAR_OPEN_CURLY_BRACES: ${ <br /> T_CLOSE_TAG: ?> <br /> T_OPEN_TAG: <?php <br /> T_COMMENT: //" <br />
Output for 4.4.2, 5.1.2, 5.1.5
//"T_OPEN_TAG: <?php <br /> " <br /> T_DOLLAR_OPEN_CURLY_BRACES: ${ <br /> T_CLOSE_TAG: ?> <br /> T_OPEN_TAG: <?php <br />
Output for 5.1.1
T_OPEN_TAG: <?php <br /> " <br /> T_DOLLAR_OPEN_CURLY_BRACES: ${ <br /> T_CLOSE_TAG: ?> <br /> T_OPEN_TAG: <?php <br /> //" <br />
Output for 5.1.0

Process exited with code 137.
Output for 4.3.0 - 4.4.1, 5.0.0 - 5.0.5
T_OPEN_TAG: <?php <br /> " <br /> T_DOLLAR_OPEN_CURLY_BRACES: ${ <br /> T_CLOSE_TAG: ?> <br /> T_OPEN_TAG: <?php <br />