xref: /ext-fiber/tests/invocable-class.phpt (revision 068e4ea3)
1--TEST--
2Reference to invocable class retained while running
3--EXTENSIONS--
4fiber
5--FILE--
6<?php
7
8class Test {
9    public function __invoke() {
10        $GLOBALS['test'] = null;
11        var_dump($this);
12        try {
13            Fiber::suspend();
14        } finally {
15            var_dump($this);
16        }
17    }
18}
19
20$test = new Test;
21$fiber = new Fiber($test);
22$fiber->start();
23
24?>
25--EXPECT--
26object(Test)#1 (0) {
27}
28object(Test)#1 (0) {
29}
30