3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); $list = [0 => 'wtf']; foreach($list as $i => $s) { switch($i) { case 'x': var_dump($i, $s); break; default: var_dump('ok'); } } var_dump(0 == 'x');
based on IQb7p
Output for 7.0.0 - 7.2.0
int(0) string(3) "wtf" bool(true)
Output for 5.4.9 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/I04if on line 1 int(0) string(3) "wtf" bool(true)
Output for 5.3.19 - 5.3.29
Warning: Unsupported declare 'strict_types' in /in/I04if on line 1 Parse error: syntax error, unexpected '[' in /in/I04if on line 3
Process exited with code 255.