xref: /PHP-8.2/Zend/tests/gh9916-004.phpt (revision 1173c2e6)
1--TEST--
2Bug GH-9916 004 (Entering shutdown sequence with a fiber suspended in a Generator emits an unavoidable fatal error or crashes)
3--FILE--
4<?php
5$gen = (function() {
6    $x = new stdClass;
7    yield from (function () {
8        $x = new stdClass;
9        print "Before suspend\n";
10        Fiber::suspend();
11        print "Not executed\n";
12        yield;
13    })();
14    print "Not executed\n";
15    yield;
16})();
17$fiber = new Fiber(function() use ($gen, &$fiber) {
18    $gen->current();
19    print "Not executed";
20});
21$fiber->start();
22?>
23==DONE==
24--EXPECT--
25Before suspend
26==DONE==
27