3v4l.org

run code in 300+ PHP versions simultaneously
<?php register_shutdown_function(function() { echo "first shutdown\n"; }); final class Another { public function __destruct() { //exit(); //throw new \RuntimeException('test'); } } final class Logger { public function __construct() { register_shutdown_function(function () { echo "shutdown\n"; }); } public function __destruct() { echo "destruct\n"; } } new Another(); new Logger(); register_shutdown_function(function() { echo "second shutdown\n"; }); 42/0;
Output for 8.3.0 - 8.3.30, 8.4.1 - 8.4.17, 8.5.0 - 8.5.2
Fatal error: Uncaught DivisionByZeroError: Division by zero in /in/moNUq:39 Stack trace: #0 {main} thrown in /in/moNUq on line 39 first shutdown shutdown second shutdown destruct
Process exited with code 255.

preferences:
53.93 ms | 406 KiB | 5 Q