Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Issue with list(), ArrayAccess and yield. https://bugs.php.net/bug.php?id=66041

View list-yield-failure.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<?php
function dumpFirstElementOfYield() {
list($value) = yield;
var_dump($value);
};
$fixedArray = new SplFixedArray(1);
$fixedArray[0] = 'the element';
$generator = dumpFirstElementOfYield();
$generator->send($fixedArray);
View list-yield-failure.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<?php
function dumpFirstElementOfYield() {
list($value) = $ASSIGN_TO_VARIABLE_INSIDE_GENERATOR = yield;
var_dump($value);
};
$fixedArray = new SplFixedArray(1);
$fixedArray[0] = 'the element';
$generator = dumpFirstElementOfYield();
$generator->send($fixedArray);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.