1--TEST-- 2Bug #69221: Segmentation fault when using a generator in combination with an Iterator 3--FILE-- 4<?php 5 6function gen() { 7 yield 1; 8}; 9 10$gen1 = gen(); 11$gen2 = (object) $gen1; 12 13foreach ($gen1 as $v1) { 14 foreach ($gen2 as $v2) { 15 break 2; 16 } 17} 18 19unset($gen1); 20foreach ($gen2 as $v) { var_dump($v); } 21 22?> 23--EXPECT-- 24int(1) 25