1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 22:11:12 +02:00
Files
archived-php-src/Zend/tests/generators/yield_from_iterator_agregate.phpt
Máté Kocsis 75a678a7e3 Declare tentative return types for Zend (#7251)
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-07-19 13:44:20 +02:00

18 lines
277 B
PHP

--TEST--
yield from with an IteratorAggregate
--FILE--
<?php
class foo implements \IteratorAggregate {
public $prop = 1;
function getIterator(): Traversable {
var_dump($this->prop);
yield;
}
}
(function(){
yield from new foo;
})()->next();
?>
--EXPECT--
int(1)