summaryrefslogtreecommitdiff
path: root/Zend/tests/bug63206.phpt
blob: 6aba55eca1ba615105b1b3f2f92fc65da8449388 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--TEST--
Bug #63206 Fully support error_handler stacking, even inside the error_handler
--FILE--
<?php

set_error_handler(function() {
    echo 'First handler' . PHP_EOL;
});

set_error_handler(function() {
    echo 'Second handler' . PHP_EOL;

    set_error_handler(function() {
        echo 'Internal handler' . PHP_EOL;
    });

    $triggerInternalNotice++; // warnings while handling the error should go into internal handler

    restore_error_handler();
});

$triggerNotice1++;
$triggerNotice2++;
?>
--EXPECT--
Second handler
Internal handler
Second handler
Internal handler