3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo($a) { $page = isset($a['page']) ? $a['page'] : 1; echo $page, "\n"; $page = $a['page'] ?? 1; echo $page, "\n"; } $a = array(); foo($a); $a = array('page' => Null); foo($a); $a = array('page' => 0); foo($a); ?>
based on D6282
Output for 7.0.0 - 7.3.0rc3
1 1 1 1 0 0
Output for 5.5.0 - 5.6.25
Parse error: syntax error, unexpected '?' in /in/D8O4L on line 8
Process exited with code 255.