3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function NC($x){ return ($x ?? "Foo"); } NC(NULL); // I know this will return "Foo". /* But I have no clue about what these will return. */ var_dump(NC(0)); var_dump(NC(-1)); var_dump(NC("")); var_dump(NC(array())); var_dump(NC("banana"));
based on tTqA1
Output for 7.0.0 - 7.2.0
int(0) int(-1) string(0) "" array(0) { } string(6) "banana"
Output for 5.3.18 - 5.6.28
Parse error: syntax error, unexpected '?' in /in/aBnLr on line 4
Process exited with code 255.