3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test { public function action(){ throw new Exception('destroyer ?'); } public function __destruct(){ echo "i'm dying"; } } $o = new Test(); try { $o->action(); } catch(Exception $ex){ echo $ex->getMessage(); } $o->action();
based on WA6kS
Output for 7.0.0 - 7.2.0
destroyer ? Fatal error: Uncaught Exception: destroyer ? in /in/mvC2E:5 Stack trace: #0 /in/mvC2E(18): Test->action() #1 {main} thrown in /in/mvC2E on line 5
Process exited with code 255.
Output for 5.3.19 - 5.6.28
destroyer ? Fatal error: Uncaught exception 'Exception' with message 'destroyer ?' in /in/mvC2E:5 Stack trace: #0 /in/mvC2E(18): Test->action() #1 {main} thrown in /in/mvC2E on line 5
Process exited with code 255.