3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { function __construct($arg) { echo $arg; } function __destruct() { echo 'destructor'; } }; function bar() { throw new Exception(); } new Foo(bar());
Output for 7.0.0 - 7.2.6
Fatal error: Uncaught Exception in /in/5cQIO:11 Stack trace: #0 /in/5cQIO(13): bar() #1 {main} thrown in /in/5cQIO on line 11
Process exited with code 255.
Output for 5.3.0 - 5.6.28
Fatal error: Uncaught exception 'Exception' in /in/5cQIO:11 Stack trace: #0 /in/5cQIO(13): bar() #1 {main} thrown in /in/5cQIO on line 11
Process exited with code 255.
Output for 5.0.5 - 5.2.17
destructor Fatal error: Uncaught exception 'Exception' in /in/5cQIO:11 Stack trace: #0 /in/5cQIO(13): bar() #1 {main} thrown in /in/5cQIO on line 11
Process exited with code 255.
Output for 5.0.3 - 5.0.4
Fatal error: Uncaught exception 'Exception' in /in/5cQIO:11 Stack trace: #0 /in/5cQIO(11): bar() #1 /in/5cQIO(13): bar() #2 {main} thrown in /in/5cQIO on line 11 destructor
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Fatal error: Uncaught exception 'Exception' in /in/5cQIO:11 Stack trace: #0 /in/5cQIO(13): bar() #1 {main} thrown in /in/5cQIO on line 11 destructor
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_NEW in /in/5cQIO on line 11
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_NEW in /in/5cQIO on line 11
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/5cQIO on line 11
Process exited with code 255.