3v4l.org

run code in 200+ 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.3.1
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.
Output for 5.6.0 - 5.6.30
Fatal error: Uncaught exception 'AException' with message 'a' in /in/uiBHJ:12 Stack trace: #0 {main} thrown in /in/uiBHJ on line 12
Process exited with code 255.