xref: /ext-fiber/tests/error-reporting.phpt (revision 068e4ea3)
1--TEST--
2Error reporting change reflected inside fiber
3--EXTENSIONS--
4fiber
5--FILE--
6<?php
7
8error_reporting(E_ALL & ~E_USER_NOTICE);
9
10$fiber = new Fiber(function (): void {
11    trigger_error("Notice A", E_USER_NOTICE); // Should be silenced.
12    Fiber::suspend();
13    trigger_error("Warning A", E_USER_WARNING);
14});
15
16$fiber->start();
17
18trigger_error("Notice B", E_USER_NOTICE); // Should be silenced.
19
20$fiber->resume();
21
22trigger_error("Warning B", E_USER_WARNING);
23
24?>
25--EXPECTF--
26Warning: Warning A in %serror-reporting.php on line %d
27
28Warning: Warning B in %serror-reporting.php on line %d
29