3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo '<PRE>'; $code = '<?php echo PHP_OS; ?>'; foreach(token_get_all($code) as $c){ if(is_array($c)){ print(token_name($c[0]).": ".htmlentities($c[1])."<br>\n"); } else { print("$c<br>\n"); } }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<PRE>T_OPEN_TAG: &lt;?php <br> T_ECHO: echo<br> T_WHITESPACE: <br> T_STRING: PHP_OS<br> ;<br> T_WHITESPACE: <br> T_CLOSE_TAG: ?&gt;<br>