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