3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { function __toString() { echo 'hola'; } } $a=new A; echo $a;
Output for 7.1.0
hola Recoverable fatal error: Method A::__toString() must return a string value in /in/3QJPX on line 9
Process exited with code 255.
Output for 5.2.0 - 5.6.28, hhvm-3.10.0, 7.0.0 - 7.0.14
hola Catchable fatal error: Method A::__toString() must return a string value in /in/3QJPX on line 9
Process exited with code 255.
Output for hhvm-3.12.0
hola Fatal error: Uncaught Error: Method A::__toString() must return a string value in /in/3QJPX:9 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.0.0 - 5.1.6
hola Fatal error: Method A::__toString() must return a string value in /in/3QJPX on line 9
Process exited with code 255.
Output for 4.3.0 - 4.4.9
Object