1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 03:03:26 +02:00
Files
archived-php-src/ext/reflection/tests/ReflectionFiber_bug_gh11121_2.phpt
Daniil Gentili 71f14510f6 Fix GH-11121: ReflectionFiber segfault
Closes GH-12391.

Co-authored-by: Aaron Piotrowski <aaron@trowski.com>
2023-10-11 17:19:01 +02:00

64 lines
966 B
PHP

--TEST--
GH-11121: Segfault when using ReflectionFiber
--FILE--
<?php
function f() {
Fiber::suspend();
}
function g() {
(new Fiber(function() {
global $f;
var_dump((new ReflectionFiber($f))->getTrace());
}))->start();
}
$f = new Fiber(function() { f(); g(); });
$f->start();
$f->resume();
?>
--EXPECTF--
array(3) {
[0]=>
array(7) {
["file"]=>
string(%d) "%sReflectionFiber_bug_gh11121_2.php"
["line"]=>
int(11)
["function"]=>
string(5) "start"
["class"]=>
string(5) "Fiber"
["object"]=>
object(Fiber)#3 (0) {
}
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
[1]=>
array(4) {
["file"]=>
string(%d) "%sReflectionFiber_bug_gh11121_2.php"
["line"]=>
int(14)
["function"]=>
string(1) "g"
["args"]=>
array(0) {
}
}
[2]=>
array(2) {
["function"]=>
string(9) "{closure}"
["args"]=>
array(0) {
}
}
}