3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo($key) { $a = ['a']; return $a[$key] ?? 'nope'; } var_dump(foo(0), foo(1));
Output for 7.0.0 - 7.2.0
string(1) "a" string(4) "nope"
Output for 5.4.9 - 5.6.28
Parse error: syntax error, unexpected '?' in /in/Rm7HU on line 7
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/Rm7HU on line 5
Process exited with code 255.