3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { echo "line 1\n"; throw new RuntimeException('exception 1'); } catch (RuntimeException $e) { echo "line 2\n"; throw new Exception('exception 2', null, $e); } catch (Exception $e) { echo "line 3\n"; } finally { echo "line 4\n"; }
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
line 1 line 2 Deprecated: Exception::__construct(): Passing null to parameter #2 ($code) of type int is deprecated in /in/Vehjf on line 8 line 4 Fatal error: Uncaught RuntimeException: exception 1 in /in/Vehjf:5 Stack trace: #0 {main} Next Exception: exception 2 in /in/Vehjf:8 Stack trace: #0 {main} thrown in /in/Vehjf on line 8
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
line 1 line 2 line 4 Fatal error: Uncaught RuntimeException: exception 1 in /in/Vehjf:5 Stack trace: #0 {main} Next Exception: exception 2 in /in/Vehjf:8 Stack trace: #0 {main} thrown in /in/Vehjf on line 8
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
line 1 line 2 line 4 Fatal error: Uncaught exception 'RuntimeException' with message 'exception 1' in /in/Vehjf:5 Stack trace: #0 {main} Next exception 'Exception' with message 'exception 2' in /in/Vehjf:8 Stack trace: #0 {main} thrown in /in/Vehjf on line 8
Process exited with code 255.

preferences:
251.61 ms | 402 KiB | 323 Q