3v4l.org

run code in 500+ PHP versions simultaneously
<?php try { $x = initSomething(); doSomething(); // may throw an exception } // no catch: exception keep their way // finally is always executed // with or without exception being caught finally{ $x->shutdown(); } ?>
Output for 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.21, 8.5.0 - 8.5.6
Warning: Undefined variable $x in /in/Wh9Ie on line 13 Fatal error: Uncaught Error: Call to undefined function initSomething() in /in/Wh9Ie:4 Stack trace: #0 {main} Next Error: Call to a member function shutdown() on null in /in/Wh9Ie:13 Stack trace: #0 {main} thrown in /in/Wh9Ie on line 13
Process exited with code 255.

preferences:
32.42 ms | 874 KiB | 4 Q