3v4l.org

run code in 300+ PHP versions simultaneously
<?php function user_exception_handler_01(Throwable $ex) { echo "01 Handled uncaught exception"; } 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_01'); set_exception_handler('user_exception_handler_02'); call_throw_it();
Output for 8.5.1
Fatal error: Uncaught Error: Maximum call stack size of 8335360 bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? in /in/ARJ9A:7 Stack trace: #0 [internal function]: user_exception_handler_02(Object(RuntimeException)) #1 {main} thrown in /in/ARJ9A on line 7
Process exited with code 255.
Output for 8.5.0
Fatal error: Uncaught Error: Maximum call stack size of 8339456 bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? in /in/ARJ9A:7 Stack trace: #0 [internal function]: user_exception_handler_02(Object(RuntimeException)) #1 {main} thrown in /in/ARJ9A on line 7
Process exited with code 255.
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.3.5 - 8.3.27, 8.4.1 - 8.4.14
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/ARJ9A:7 Stack trace: #0 [internal function]: user_exception_handler_02(Object(RuntimeException)) #1 {main} thrown in /in/ARJ9A on line 7
Process exited with code 255.
Output for 8.3.28
Fatal error: Uncaught Error: Maximum call stack size of 8331264 bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? in /in/ARJ9A:7 Stack trace: #0 [internal function]: user_exception_handler_02(Object(RuntimeException)) #1 {main} thrown in /in/ARJ9A on line 7
Process exited with code 255.
Output for 8.3.0 - 8.3.4
01 Handled uncaught exception
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29
Fatal error: Uncaught RuntimeException: Not able to handle, throwing another exception from handler in /in/ARJ9A:9 Stack trace: #0 [internal function]: user_exception_handler_02(Object(RuntimeException)) #1 {main} thrown in /in/ARJ9A on line 9
Process exited with code 255.

preferences:
71 ms | 415 KiB | 5 Q