xref: /php-src/Zend/tests/fibers/gh10340-003.phpt (revision 98302042)
1--TEST--
2Bug GH-10340 003 (Assertion in zend_fiber_object_gc())
3--FILE--
4<?php
5
6class C {
7    public function __destruct() {
8        echo __METHOD__, "\n";
9    }
10}
11
12function f() {
13    $c = new C();
14    $y = 'a';
15    $$y = Fiber::getCurrent();
16    Fiber::suspend();
17}
18
19$fiber = new Fiber(function() {
20    get_defined_vars();
21    f();
22});
23
24$fiber->start();
25
26print "1\n";
27
28$fiber = null;
29gc_collect_cycles();
30
31print "2\n";
32?>
33==DONE==
34--EXPECT--
351
36C::__destruct
372
38==DONE==
39