php IHDR w Q )Ba pHYs sRGB gAMA a IDATxMk\U s&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨ G;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j- $_q?qS XzG'ay

| files >> /proc/self/root/var/www/html/sub/images/Rm19_symconf/root/opt/php-7.0.1/Zend/tests/ |
| files >> //proc/self/root/var/www/html/sub/images/Rm19_symconf/root/opt/php-7.0.1/Zend/tests/bug62991.phpt |
--TEST--
Bug #62991 (Segfault with generator and closure)
--FILE--
<?php
function test( array $array )
{
$closure = function() use ( $array ) {
print_r( $array );
yield "hi";
};
return $closure();
}
function test2( array $array )
{
$closure = function() use ( $array ) {
print_r( $array );
yield "hi";
};
return $closure; // if you return the $closure and call it outside this function it works.
}
$generator = test(array( 1, 2, 3 ) );
foreach($generator as $something) {
}
$generator = test2(array( 1, 2, 3 ) );
foreach($generator() as $something) {
}
$generator = test2(array( 1, 2, 3 ) );
echo "okey\n";
?>
--EXPECT--
Array
(
[0] => 1
[1] => 2
[2] => 3
)
Array
(
[0] => 1
[1] => 2
[2] => 3
)
okey
y~or5J={Eeu磝Qk ᯘG{?+]ן?wM3X^歌>{7پK>on\jy Rg/=fOroNVv~Y+ NGuÝHWyw[eQʨSb> >}Gmx[o[<{Ϯ_qFvM IENDB`