xref: /php-src/Zend/tests/fibers/gh9735-002.phpt (revision 4fb14939)
1--TEST--
2Bug GH-9735 002 (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() {
13    Fiber::suspend();
14}
15
16$fiber = new Fiber(function () {
17    $c = new C();
18
19    $fiber = Fiber::getCurrent();
20
21    f();
22});
23
24print "1\n";
25
26$fiber->start();
27gc_collect_cycles();
28
29print "2\n";
30
31$fiber = null;
32gc_collect_cycles();
33
34print "3\n";
35
36?>
37--EXPECT--
381
392
40C::__destruct
413
42