mirror of
https://github.com/php/php-src.git
synced 2025-01-12 05:54:13 +08:00
9589cae8cb
Yield return values now use IS_VAR rather than IS_TMP_VAR. This fixes the issue with list() and should also be faster as it avoids doing a zval copy.
18 lines
330 B
PHP
18 lines
330 B
PHP
--TEST--
|
|
Bug #66041: list() fails to unpack yielded ArrayAccess object
|
|
--FILE--
|
|
<?php
|
|
function dumpElement() {
|
|
list($value) = yield;
|
|
var_dump($value);
|
|
};
|
|
|
|
$fixedArray = new SplFixedArray(1);
|
|
$fixedArray[0] = 'the element';
|
|
|
|
$generator = dumpElement();
|
|
$generator->send($fixedArray);
|
|
?>
|
|
--EXPECT--
|
|
string(11) "the element"
|