1--TEST-- 2GH-11121: Segfault when using ReflectionFiber 3--FILE-- 4<?php 5 6function f() { 7 Fiber::suspend(); 8} 9 10function g() { 11 (new Fiber(function() { 12 global $f; 13 var_dump((new ReflectionFiber($f))->getTrace()); 14 }))->start(); 15} 16 17$f = new Fiber(function() { f(); g(); }); 18$f->start(); 19$f->resume(); 20 21?> 22--EXPECTF-- 23array(3) { 24 [0]=> 25 array(7) { 26 ["file"]=> 27 string(%d) "%sReflectionFiber_bug_gh11121_2.php" 28 ["line"]=> 29 int(11) 30 ["function"]=> 31 string(5) "start" 32 ["class"]=> 33 string(5) "Fiber" 34 ["object"]=> 35 object(Fiber)#3 (0) { 36 } 37 ["type"]=> 38 string(2) "->" 39 ["args"]=> 40 array(0) { 41 } 42 } 43 [1]=> 44 array(4) { 45 ["file"]=> 46 string(%d) "%sReflectionFiber_bug_gh11121_2.php" 47 ["line"]=> 48 int(14) 49 ["function"]=> 50 string(1) "g" 51 ["args"]=> 52 array(0) { 53 } 54 } 55 [2]=> 56 array(2) { 57 ["function"]=> 58 string(%d) "{closure:%s:%d}" 59 ["args"]=> 60 array(0) { 61 } 62 } 63} 64