1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/Zend/tests/generators/yield_from_array.phpt
2020-02-03 22:52:20 +01:00

23 lines
277 B
PHP

--TEST--
yielding values from an array
--FILE--
<?php
function from() {
yield 0;
yield from []; // must not yield anything
yield from [1,2];
}
function gen() {
yield from from();
}
foreach(gen() as $v) {
var_dump($v);
}
?>
--EXPECT--
int(0)
int(1)
int(2)