1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 22:11:12 +02:00
Files
archived-php-src/Zend/tests/bug63206_2.phpt
Mark Plomer 8c6a7c3326 Fix #63206: Fully support error/exception_handler stacking, even with null or inside the handler
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.
2020-02-25 12:43:42 +01:00

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