Is there a way to access the KEY of the YIELD or it is acceptable only through foreach loop?
function foo()
{
yield 'bar' => 'baz';
}
$foo = foo();
foreach ($foo as $key => $val)
echo $key; // output: bar
$foo = foo();
echo key($foo->current()); //Warning: key() expects parameter 1 to be array, string given