3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public function __toString() { return 42; } } class Bar extends Foo {} echo new Bar;
based on C4HXT
Output for 7.1.0 - 7.2.0
Recoverable fatal error: Method Bar::__toString() must return a string value in /in/80pZp on line 8
Process exited with code 255.
Output for 5.3.18 - 7.0.20
Catchable fatal error: Method Bar::__toString() must return a string value in /in/80pZp on line 8
Process exited with code 255.