xref: /PHP-8.4/Zend/tests/gh13446_4.phpt (revision 3301d960)
1--TEST--
2GH-13446: Exception handler isn't restored if stack is empty
3--FILE--
4<?php
5function exception_handler() {
6    echo "Handler\n";
7    restore_exception_handler();
8    restore_exception_handler();
9}
10set_exception_handler('exception_handler');
11
12register_shutdown_function(function () {
13    var_dump(set_exception_handler(null));
14    restore_exception_handler();
15});
16
17throw new Exception();
18?>
19--EXPECT--
20Handler
21NULL
22