summaryrefslogtreecommitdiff
path: root/Zend/tests/generators/yield_from_array.phpt
blob: b1560170b1d20d78ee26c84aeb66c519ca2a57b3 (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)