3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class MyClass { public $myVar; public function myMethod() { } } $instance = new MyClass(); $instance->myVar = "Hello World"; // Assign "Hello World" to "myVar" $instance->myMethod(); // Run "myMethod()" echo $instance; ?>
based on jC6U7
Output for 7.1.0 - 7.2.0
Recoverable fatal error: Object of class MyClass could not be converted to string in /in/Ef2pR on line 15
Process exited with code 255.
Output for 5.3.17 - 7.0.20
Catchable fatal error: Object of class MyClass could not be converted to string in /in/Ef2pR on line 15
Process exited with code 255.