3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $vars=[ '^hello', 123, false, 1.23, ] foreach($vars as $var) { echo ($var[0]=='^') ? substr($var,1) : 'false', PHP_EOL; }
Output for 5.4.0 - 5.4.29
Parse error: syntax error, unexpected 'foreach' (T_FOREACH) in /in/GtvF3 on line 11
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected '[' in /in/GtvF3 on line 4
Process exited with code 255.