xref: /PHP-8.2/Zend/tests/fibers/gh9735-001.phpt (revision 4fb14939)
1--TEST--
2Bug GH-9735 001 (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
12$fiber = new Fiber(function () {
13    $c = new C();
14
15    $fiber = Fiber::getCurrent();
16
17    Fiber::suspend();
18});
19
20print "1\n";
21
22$fiber->start();
23gc_collect_cycles();
24
25print "2\n";
26
27$fiber = null;
28gc_collect_cycles();
29
30print "3\n";
31
32?>
33--EXPECT--
341
352
36C::__destruct
373
38