3v4l.org

run code in 300+ PHP versions simultaneously
<?php function user_exception_handler_02(Throwable $ex) { restore_exception_handler(); throw new RuntimeException("Not able to handle, throwing another exception from handler"); echo "Should never see this"; } function throw_it() { throw new RuntimeException('Expected unexpected happened'); } function call_throw_it() { throw_it(); } set_exception_handler('user_exception_handler_02'); call_throw_it();
Output for 8.3.5 - 8.3.25, 8.4.1 - 8.4.12
Fatal error: Uncaught Error: Maximum call stack size of 8306688 bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? in /in/Hct7c:3 Stack trace: #0 [internal function]: user_exception_handler_02(Object(RuntimeException)) #1 {main} thrown in /in/Hct7c on line 3
Process exited with code 255.
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.4
Fatal error: Uncaught RuntimeException: Not able to handle, throwing another exception from handler in /in/Hct7c:5 Stack trace: #0 [internal function]: user_exception_handler_02(Object(RuntimeException)) #1 {main} thrown in /in/Hct7c on line 5
Process exited with code 255.

preferences:
71.02 ms | 408 KiB | 5 Q