3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { function get() { throw new Exception(); } } class B { function __toString() { $a = new A; return $a->get(); } } $b = new B; var_dump((string) $b);
Output for 7.0.1 - 7.2.0
Fatal error: Method B::__toString() must not throw an exception, caught Exception: in /in/vtvLW on line 0
Process exited with code 255.
Output for 5.3.20 - 7.0.0
Fatal error: Method B::__toString() must not throw an exception in /in/vtvLW on line 0
Process exited with code 255.