mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
b3e33be443
Fixes GH-10695 Closes GH-110905
18 lines
467 B
PHP
18 lines
467 B
PHP
--TEST--
|
|
GH-10695: Exception handlers can register another exception handler
|
|
--FILE--
|
|
<?php
|
|
set_exception_handler(function (\Throwable $exception) {
|
|
echo 'Caught: ' . $exception->getMessage() . "\n";
|
|
set_exception_handler(function (\Throwable $exception) {
|
|
echo 'Caught: ' . $exception->getMessage() . "\n";
|
|
});
|
|
throw new \Exception('exception handler');
|
|
});
|
|
|
|
throw new \Exception('main');
|
|
?>
|
|
--EXPECT--
|
|
Caught: main
|
|
Caught: exception handler
|