xref: /PHP-8.3/Zend/tests/fibers/gh9735-006.phpt (revision 4fb14939)
1--TEST--
2Bug GH-9735 006 (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    // Force symbol table
14    get_defined_vars();
15
16    Fiber::suspend();
17}
18
19$fiber = new Fiber(function () {
20    $c = new C();
21
22    $fiber = Fiber::getCurrent();
23
24    // Force symbol table
25    get_defined_vars();
26
27    f();
28});
29
30print "1\n";
31
32$fiber->start();
33gc_collect_cycles();
34
35print "2\n";
36
37$fiber = null;
38gc_collect_cycles();
39
40print "3\n";
41
42?>
43--EXPECTF--
441
452
46C::__destruct
473
48