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.27, 7.4.0 - 7.4.16, 8.0.0 - 8.0.3
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.