mirror of
https://github.com/php/php-src.git
synced 2026-04-22 15:38:49 +02:00
8c6a7c3326
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
432 B
PHP
27 lines
432 B
PHP
--TEST--
|
|
Bug #63206 Fully support error_handler stacking, even with null
|
|
--FILE--
|
|
<?php
|
|
|
|
set_error_handler(function() {
|
|
echo 'First handler' . PHP_EOL;
|
|
});
|
|
|
|
set_error_handler(function() {
|
|
echo 'Second handler' . PHP_EOL;
|
|
});
|
|
|
|
set_error_handler(null);
|
|
|
|
set_error_handler(function() {
|
|
echo 'Fourth handler' . PHP_EOL;
|
|
});
|
|
|
|
restore_error_handler();
|
|
restore_error_handler();
|
|
|
|
$triggerNotice++;
|
|
?>
|
|
--EXPECTF--
|
|
Second handler
|