1--TEST-- 2ReflectionFiber should not segfault when inspecting fibers where the previous stack frame is a native function 3--FILE-- 4<?php 5 6namespace test; 7 8$f = new \Fiber(fn() => call_user_func(["Fiber", "suspend"])); 9$f->start(); 10 11$reflection = new \ReflectionFiber($f); 12 13var_dump($reflection->getExecutingFile()); 14var_dump($reflection->getExecutingLine()); 15var_dump($reflection->getTrace()); 16 17?> 18--EXPECTF-- 19string(%d) "%sReflectionFiber_notrace_2.php" 20int(5) 21array(3) { 22 [0]=> 23 array(4) { 24 ["function"]=> 25 string(7) "suspend" 26 ["class"]=> 27 string(5) "Fiber" 28 ["type"]=> 29 string(2) "::" 30 ["args"]=> 31 array(0) { 32 } 33 } 34 [1]=> 35 array(4) { 36 ["file"]=> 37 string(%d) "%sReflectionFiber_notrace_2.php" 38 ["line"]=> 39 int(5) 40 ["function"]=> 41 string(14) "call_user_func" 42 ["args"]=> 43 array(1) { 44 [0]=> 45 array(2) { 46 [0]=> 47 string(5) "Fiber" 48 [1]=> 49 string(7) "suspend" 50 } 51 } 52 } 53 [2]=> 54 array(2) { 55 ["function"]=> 56 string(%d) "{closure:%s:%d}" 57 ["args"]=> 58 array(0) { 59 } 60 } 61} 62