3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Person { function getN(){return 5;} function ret(){return $this;} function retN(){return null;} } class NullPerson extends Person { function getN(){return 0;} function ret(){return $this;} function retN(){return null;} } $a = new Person(); $b = null; var_dump(($a??new NullPerson())->getN(), ($b??new NullPerson())->getN());
based on fa8Pa
Output for 7.0.0 - 7.2.0
int(5) int(0)
Output for 5.3.20 - 5.6.28
Parse error: syntax error, unexpected '?' in /in/NpbIP on line 19
Process exited with code 255.