xref: /PHP-8.2/Zend/tests/gh9916-005.phpt (revision 1173c2e6)
1--TEST--
2Bug GH-9916 005 (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    $fiber = yield;
8    print "Before suspend\n";
9    Fiber::suspend();
10    yield;
11})();
12$fiber = new Fiber(function() use ($gen, &$fiber) {
13    $gen->send($fiber);
14    $gen->current();
15});
16$fiber->start();
17
18$gen = null;
19$fiber = null;
20gc_collect_cycles();
21?>
22==DONE==
23--EXPECT--
24Before suspend
25==DONE==
26