<?php
class Foo {
function __construct($arg) {
echo $arg;
}
function __destruct() {
echo 'destructor';
}
};
function bar() {
throw new Exception();
}
new Foo(bar());
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.
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.1.0 - 5.1.6, 5.2.0 - 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.