xref: /PHP-8.4/Zend/tests/gh13446_1.phpt (revision 3301d960)
1--TEST--
2GH-13446: Exception handler is restored after is has finished
3--FILE--
4<?php
5function exception_handler($ex) {
6    echo 'Exception caught: ', $ex->getMessage(), "\n";
7}
8set_exception_handler('exception_handler');
9
10register_shutdown_function(function () {
11    echo set_exception_handler(null), "\n";
12    restore_exception_handler();
13});
14
15throw new Exception('Test');
16?>
17--EXPECT--
18Exception caught: Test
19exception_handler
20