1--TEST-- 2The result of a by-ref function call can be yielded just fine 3--FILE-- 4<?php 5 6function &nop(&$var) { 7 return $var; 8} 9 10function &gen(&$var) { 11 yield nop($var); 12} 13 14$var = "foo"; 15$gen = gen($var); 16foreach ($gen as &$varRef) { 17 $varRef = "bar"; 18} 19 20var_dump($var); 21 22?> 23--EXPECT-- 24string(3) "bar" 25