3v4l.org

run code in 300+ PHP versions simultaneously
<?php class AException extends \Exception { } class BException extends \Exception { } try { throw new \AException('a'); } catch (BException $e) { echo 1; } echo 2;
Output for 7.0.0 - 7.0.24, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.30, 8.0.0 - 8.0.22, 8.1.0 - 8.1.9
Fatal error: Uncaught AException: a in /in/uiBHJ:12 Stack trace: #0 {main} thrown in /in/uiBHJ on line 12
Process exited with code 255.

preferences:
24.51 ms | 410 KiB | 5 Q