xref: /PHP-8.2/Zend/tests/bug63206.phpt (revision 5dafd7b4)
1--TEST--
2Bug #63206 Fully support error_handler stacking, even inside the error_handler
3--FILE--
4<?php
5
6set_error_handler(function() {
7    echo 'First handler' . PHP_EOL;
8});
9
10set_error_handler(function() {
11    echo 'Second handler' . PHP_EOL;
12
13    set_error_handler(function() {
14        echo 'Internal handler' . PHP_EOL;
15    });
16
17    $triggerInternalNotice++; // warnings while handling the error should go into internal handler
18
19    restore_error_handler();
20});
21
22$triggerNotice1++;
23$triggerNotice2++;
24?>
25--EXPECT--
26Second handler
27Internal handler
28Second handler
29Internal handler
30