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 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
int(0) zero NULL zero bool(false) zero string(0) "" zero string(8) "a string" zero string(1) "1" string(4) "1cat"
Output for hhvm-3.10.0

Process exited with code 153.