3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = null; var_dump($a->test->getValue() ?? 'test');
Output for 7.2.5 - 7.3.0beta1
Notice: Trying to get property 'test' of non-object in /in/LaaZR on line 5 Fatal error: Uncaught Error: Call to a member function getValue() on null in /in/LaaZR:5 Stack trace: #0 {main} thrown in /in/LaaZR on line 5
Process exited with code 255.
Output for 7.0.0 - 7.1.20
Notice: Trying to get property of non-object in /in/LaaZR on line 5 Fatal error: Uncaught Error: Call to a member function getValue() on null in /in/LaaZR:5 Stack trace: #0 {main} thrown in /in/LaaZR on line 5
Process exited with code 255.
Output for hhvm-3.15.4
Notice: Cannot access property on non-object in /in/LaaZR on line 5 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function getValue() on a non-object (null)' in /in/LaaZR:5 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected '?' in /in/LaaZR on line 5
Process exited with code 255.