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.3.1
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 hhvm-3.22.0
destroyer ? Fatal error: Uncaught exception 'Exception' with message 'destroyer ?' in /in/mvC2E:-1 Stack trace: #0 /in/mvC2E(-1): Test->action() #1 {main} i'm dying
Process exited with code 255.
Output for hhvm-3.10.1 - 3.21.3
destroyer ? Fatal error: Uncaught exception 'Exception' with message 'destroyer ?' in /in/mvC2E:5 Stack trace: #0 /in/mvC2E(18): Test->action() #1 {main} i'm dying
Process exited with code 255.
Output for 5.1.3 - 5.6.38
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.
Output for 5.0.0 - 5.0.2, 5.0.5 - 5.1.2
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 i'm dying
Process exited with code 255.
Output for 5.0.3 - 5.0.4
destroyer ? Fatal error: Uncaught exception 'Exception' with message 'destroyer ?' in /in/mvC2E:5 Stack trace: #0 /in/mvC2E(5): Test::action() #1 /in/mvC2E(18): Test->action() #2 {main} thrown in /in/mvC2E on line 5 i'm dying
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/mvC2E on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/mvC2E on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/mvC2E on line 4
Process exited with code 255.