3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { function __toString() { throw new \Exception('My err mes'); } } $d = new Foo(); (string) $d;
based on DJnF7
Output for 7.0.1 - 7.2.0
Fatal error: Method Foo::__toString() must not throw an exception, caught Exception: My err mes in /in/JvgvTh on line 0
Process exited with code 255.
Output for 5.3.21 - 7.0.0
Fatal error: Method Foo::__toString() must not throw an exception in /in/JvgvTh on line 0
Process exited with code 255.