3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function profiler($a, $b, $c) { $profiler = true; switch (true) { case $a; case $b; case $c; $profiler = false; } return $profiler; } // last true echo "True:\n=======\n"; var_dump(profiler(true, true, true)); var_dump(profiler(false, false, true)); var_dump(profiler(true, false, true)); var_dump(profiler(false, true, true)); // last not true echo "\n\nNot true:\n======\n"; var_dump(profiler(false, false, false)); var_dump(profiler(true, false, false)); var_dump(profiler(false, true, false)); var_dump(profiler(true, true, false));
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
True: ======= bool(false) bool(false) bool(false) bool(false) Not true: ====== bool(true) bool(false) bool(false) bool(false)
Output for hhvm-3.10.0

Process exited with code 153.