3v4l.org

run code in 300+ PHP versions simultaneously
<?php function check($value) { if ($value != "") { echo 'is not an empty string'; } else if ($value == '') { echo 'is an empty string'; } else { echo 'something else'; } } foreach(array( '', 0, false, true, null, -1, array(), 1, '0', '1' )) as $value) { var_export($value); echo check($value), "\n\n"; }
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.28
Parse error: syntax error, unexpected ')' in /in/76ln7 on line 22
Process exited with code 255.

preferences:
185.13 ms | 1395 KiB | 65 Q