3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function testSwitch($value) { switch($value) { case 'foo': return 'foo was given'; case 'bar': return 'bar was given'; default: return 'undefined value was given'; } } var_dump(testSwitch('foo')); var_dump(testSwitch('bar')); var_dump(testSwitch(''));
Output for 4.3.0 - 7.1.0
string(13) "foo was given" string(13) "bar was given" string(25) "undefined value was given"