3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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();
Output for 7.0.0 - 7.2.0
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.3.19 - 5.6.28
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.