3v4l.org

run code in 500+ 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 7.3.6 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.34, 8.3.0 - 8.3.35, 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.
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.

preferences:
26.91 ms | 1154 KiB | 7 Q