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