3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace HHVM\UserDocumentation\Inconsistencies\Intro\Examples\toStringExc; class A { public function __toString() { throw new \Exception('Not allowed in PHP'); return 'A'; } } $a = new A(); echo $a;
based on RLp27
Output for 7.0.1 - 7.2.0
Fatal error: Method HHVM\UserDocumentation\Inconsistencies\Intro\Examples\toStringExc\A::__toString() must not throw an exception, caught Exception: Not allowed in PHP in /in/kgrk5 on line 0
Process exited with code 255.
Output for 5.5.0 - 7.0.0
Fatal error: Method HHVM\UserDocumentation\Inconsistencies\Intro\Examples\toStringExc\A::__toString() must not throw an exception in /in/kgrk5 on line 0
Process exited with code 255.