xref: /PHP-8.4/Zend/tests/gh10695_5.phpt (revision b3e33be4)
1--TEST--
2GH-10695: Exception handlers can register another exception handler
3--FILE--
4<?php
5set_exception_handler(function (\Throwable $exception) {
6    echo 'Caught: ' . $exception->getMessage() . "\n";
7    set_exception_handler(function (\Throwable $exception) {
8        echo 'Caught: ' . $exception->getMessage() . "\n";
9    });
10    throw new \Exception('exception handler');
11});
12
13throw new \Exception('main');
14?>
15--EXPECT--
16Caught: main
17Caught: exception handler
18