1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 17:22:15 +01:00
Files
archived-php-src/Zend/tests/generators/yield_from_iterator.phpt
2015-04-21 19:42:23 +02:00

22 lines
248 B
PHP

--TEST--
yield from with an (Array)Iterator
--FILE--
<?php
function g() {
yield 1;
yield from new ArrayIterator([2, 3, 4]);
yield 5;
}
$g = g();
foreach ($g as $yielded) {
var_dump($yielded);
}
?>
--EXPECT--
int(1)
int(2)
int(3)
int(4)
int(5)