1--TEST--
2Out of Memory in a nested fiber
3--EXTENSIONS--
4fiber
5--INI--
6memory_limit=10K
7--SKIPIF--
8<?php
9if (getenv("USE_ZEND_ALLOC") === "0") {
10    die("skip Zend MM disabled");
11}
12?>
13--FILE--
14<?php
15
16$fiber = new Fiber(function (): void {
17    $fiber = new Fiber(function (): void {
18        $buffer = '';
19        while (true) {
20            $buffer .= str_repeat('.', 1 << 10);
21        }
22    });
23
24    $fiber->start();
25});
26
27$fiber->start();
28
29?>
30--EXPECTF--
31Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %sout-of-memory-in-nested-fiber.php on line %d
32