<?php
class Test {
public static function run()
{
$o = new Test('o');
throw new Exception('destroyer ?');
}
public static function shutdown()
{
echo 'fin script'."\n";
}
public function __construct(){
echo 'constructeur'."\n";
}
public function __destruct(){
echo 'destructeur'."\n";
}
}
register_shutdown_function(array('Test','shutdown'));
Test::run();
constructeur
destructeur
Fatal error: Uncaught Exception: destroyer ? in /in/PDW2J:7
Stack trace:
#0 /in/PDW2J(21): Test::run()
#1 {main}
thrown in /in/PDW2J on line 7
fin script
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
constructeur
destructeur
Fatal error: Uncaught exception 'Exception' with message 'destroyer ?' in /in/PDW2J:7
Stack trace:
#0 /in/PDW2J(21): Test::run()
#1 {main}
thrown in /in/PDW2J on line 7
fin script
Process exited with code 255.