php-8.0.30-src/Zend/tests/generators/yield_from_iterator_agregat...

18 lines
264 B
PHP

--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)