summaryrefslogtreecommitdiff
path: root/Zend/tests/generators/yield_from_array.phpt
blob: 1652ab22365b9c5a9b62f19f1dce7d7909630d6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--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)