3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { function bar() { return null; } } var_dump((new Foo)->bar()->bar() ?? 3);
based on Re3og
Output for 7.0.0 - 7.3.0beta1
Fatal error: Uncaught Error: Call to a member function bar() on null in /in/7RSlV:9 Stack trace: #0 {main} thrown in /in/7RSlV on line 9
Process exited with code 255.
Output for 5.4.12 - 5.6.28
Parse error: syntax error, unexpected '?' in /in/7RSlV on line 9
Process exited with code 255.
Output for 5.3.22 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/7RSlV on line 9
Process exited with code 255.