3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { doSomething(); } catch (Exception $e) { processException($e); } finally { cleanupWork(); } // finally is optional try { doSomething(); } catch (Exception $e) { processException($e); } // catch is optional try { doSomething(); } // In the end, catch is also optional doSomething(); ?>
Output for 8.5.0
Fatal error: Cannot use try without catch or finally in /in/jOtGX on line 19 Stack trace: #0 {main}
Process exited with code 255.
Output for 7.3.6, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.15
Fatal error: Cannot use try without catch or finally in /in/jOtGX on line 19
Process exited with code 255.

preferences:
175.99 ms | 1010 KiB | 7 Q