xref: /php-src/Zend/tests/fibers/gh10496-002.phpt (revision 95016138)
1--TEST--
2Bug GH-10496 002 (Segfault when garbage collector is invoked inside of fiber)
3--FILE--
4<?php
5
6function pollute_stack_and_suspend($a = 1, $b = 2, $c = 3) {
7    Fiber::suspend();
8}
9
10$f = new Fiber(function() use (&$f) {
11    pollute_stack_and_suspend();
12    (function() {
13        (function() {
14            (new Fiber(function() {
15                gc_collect_cycles();
16                echo "Success\n";
17            }))->start();
18        })();
19    })();
20});
21$f->start();
22$f->resume();
23
24?>
25--EXPECT--
26Success
27