3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class foo { function do_foo() { echo "Doing foo."; } } $bar = new foo; $bajr->do_foo(); ?>
based on 1WbRo
Output for 7.0.5 - 7.2.0
Notice: Undefined variable: bajr in /in/h4Pb4 on line 11 Fatal error: Uncaught Error: Call to a member function do_foo() on null in /in/h4Pb4:11 Stack trace: #0 {main} thrown in /in/h4Pb4 on line 11
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Notice: Undefined variable: bajr in /in/h4Pb4 on line 11 Fatal error: Uncaught Error: Call to a member function do_foo() on unknown in /in/h4Pb4:11 Stack trace: #0 {main} thrown in /in/h4Pb4 on line 11
Process exited with code 255.
Output for 5.6.7 - 5.6.28
Notice: Undefined variable: bajr in /in/h4Pb4 on line 11 Fatal error: Call to a member function do_foo() on null in /in/h4Pb4 on line 11
Process exited with code 255.
Output for 5.3.18 - 5.5.35
Notice: Undefined variable: bajr in /in/h4Pb4 on line 11 Fatal error: Call to a member function do_foo() on a non-object in /in/h4Pb4 on line 11
Process exited with code 255.