xref: /PHP-8.2/Zend/tests/fibers/gh9735-008.phpt (revision 4fb14939)
1--TEST--
2Bug GH-9735 008 (Fiber stack variables do not participate in cycle collector)
3--FILE--
4<?php
5
6class C {
7    public function __destruct() {
8        echo __METHOD__, "\n";
9    }
10}
11
12function f($a, $b) {
13}
14
15function g() {
16    Fiber::suspend();
17}
18
19$fiber = new Fiber(function () {
20    $c = new C();
21
22    f(Fiber::getCurrent(), g());
23});
24
25print "1\n";
26
27$fiber->start();
28gc_collect_cycles();
29
30print "2\n";
31
32$fiber = null;
33gc_collect_cycles();
34
35print "3\n";
36
37?>
38--EXPECTF--
391
402
41C::__destruct
423
43