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