xref: /PHP-8.2/Zend/tests/gh15330-002.phpt (revision cd255007)
1--TEST--
2GH-15330 002: Do not scan generator frames more than once
3--FILE--
4<?php
5
6function g() {
7    yield 'foo';
8    Fiber::suspend();
9}
10
11function f() {
12    var_dump(yield from g());
13}
14
15$iterable = f();
16
17$fiber = new Fiber(function () use ($iterable) {
18    var_dump($iterable->current());
19    $iterable->next();
20    var_dump("not executed");
21});
22
23$ref = $fiber;
24
25$fiber->start();
26
27gc_collect_cycles();
28
29?>
30==DONE==
31--EXPECT--
32string(3) "foo"
33==DONE==
34