mirror of
https://github.com/php/php-src.git
synced 2026-04-19 22:11:12 +02:00
Always push the current user_error/exception_handler to the stack, even when it is empty, so restore_error_handler() always works as expected. The user_error_handler is especially temporarily empty when we are inside the error handler, which caused inconsistent behaviour before.
27 lines
465 B
PHP
27 lines
465 B
PHP
--TEST--
|
|
Bug #63206 Fully support exception_handler stacking, even with null
|
|
--FILE--
|
|
<?php
|
|
|
|
set_exception_handler(function() {
|
|
echo 'First handler' . PHP_EOL;
|
|
});
|
|
|
|
set_exception_handler(function() {
|
|
echo 'Second handler' . PHP_EOL;
|
|
});
|
|
|
|
set_exception_handler(null);
|
|
|
|
set_exception_handler(function() {
|
|
echo 'Fourth handler' . PHP_EOL;
|
|
});
|
|
|
|
restore_exception_handler();
|
|
restore_exception_handler();
|
|
|
|
throw new Exception();
|
|
?>
|
|
--EXPECTF--
|
|
Second handler
|