<?php
class Test
{
public function __destruct()
{
echo 'destruct', PHP_EOL;
}
public function __construct()
{
echo 'construct', PHP_EOL;
}
}
echo 'start', PHP_EOL;
new Test();
throw new Exception();
echo 'stop', PHP_EOL;
start
construct
destruct
Fatal error: Uncaught Exception in /in/obEDd:19
Stack trace:
#0 {main}
thrown in /in/obEDd on line 19
Process exited with code 255.
start
construct
destruct
Fatal error: Uncaught exception 'Exception' in /in/obEDd:19
Stack trace:
#0 {main}
thrown in /in/obEDd on line 19
Process exited with code 255.