1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
--TEST-- yield from with an IteratorAggregate --FILE-- <?php class foo implements \IteratorAggregate { public $prop = 1; function getIterator() { var_dump($this->prop); yield; } } (function(){ yield from new foo; })()->next(); ?> --EXPECT-- int(1)