3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function doit($v) { var_dump($v); switch ($v) { case 0: echo "zero"; break; case null: echo "null"; break; case false: echo "false"; break; case '': echo "''"; break; } echo "\n\n"; } foreach (array(0, null, false, '', 'a string', '1', '1cat) as $v) doit($v);
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected ''1cat) as $v) doit($v);' (T_ENCAPSED_AND_WHITESPACE), expecting ')' in /in/p8a8A on line 14
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ')' in /in/p8a8A on line 14
Process exited with code 255.