3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $obj = 123; // Create a new instance of MyObject into $obj $obj->thisProperty = 'Fred'; // Set a property in the $obj object called thisProperty $obj->getProperty(); // Call a method of the $obj object named getProperty ?>
based on OL1DA
Output for 7.2.0
Warning: Attempt to assign property 'thisProperty' of non-object in /in/iv4tl on line 3 Fatal error: Uncaught Error: Call to a member function getProperty() on integer in /in/iv4tl:4 Stack trace: #0 {main} thrown in /in/iv4tl on line 4
Process exited with code 255.
Output for 7.0.0 - 7.1.10
Warning: Attempt to assign property of non-object in /in/iv4tl on line 3 Fatal error: Uncaught Error: Call to a member function getProperty() on integer in /in/iv4tl:4 Stack trace: #0 {main} thrown in /in/iv4tl on line 4
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Warning: Attempt to assign property of non-object in /in/iv4tl on line 3 Fatal error: Call to a member function getProperty() on integer in /in/iv4tl on line 4
Process exited with code 255.
Output for 5.4.0 - 5.5.38
Warning: Attempt to assign property of non-object in /in/iv4tl on line 3 Fatal error: Call to a member function getProperty() on a non-object in /in/iv4tl on line 4
Process exited with code 255.