3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function incre() { return [ 1 => null, 2 => null, 3 => 1, ]; } $a = incre()[0] ?? 0; var_dump($a); $b = incre()[1] ?? 0; var_dump($b); $c = incre()[3] ?? 0; var_dump($c);
Output for 7.0.28 - 7.3.0rc3
int(0) int(0) int(1)
Output for 5.6.38
Parse error: syntax error, unexpected '?' in /in/cFjLf on line 11
Process exited with code 255.