summaryrefslogtreecommitdiff
path: root/Zend/tests/generators/bug79600.phpt
blob: 4abe9784b694454d5ae105965b5f4cbe6dbb5679 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
Bug #79600: Regression in 7.4.6 when yielding an array based generator
--FILE--
<?php

function createArrayGenerator() {
    yield from [
        1,
        2,
    ];
}

function createGeneratorFromArrayGenerator() {
    yield from createArrayGenerator();
}

foreach (createGeneratorFromArrayGenerator() as $value) {
    echo $value, "\n";
}

?>
--EXPECT--
1
2