xref: /PHP-8.3/Zend/tests/gh10695_7.phpt (revision b3e33be4)
1--TEST--
2GH-10695: Exceptions in error handlers during shutdown are caught
3--FILE--
4<?php
5set_exception_handler(function (\Throwable $exception) {
6    echo 'Caught: ' . $exception->getMessage() . "\n";
7});
8set_error_handler(function ($errno, $errstr) {
9    throw new \Exception($errstr);
10});
11register_shutdown_function(function () {
12    trigger_error('main', E_USER_ERROR);
13});
14?>
15--EXPECT--
16Caught: main
17