1--TEST--
2Observer: Generator with 'yield from'
3--EXTENSIONS--
4zend_test
5--INI--
6zend_test.observer.enabled=1
7zend_test.observer.show_output=1
8zend_test.observer.observe_all=1
9zend_test.observer.show_return_value=1
10--FILE--
11<?php
12function barResults() {
13    for ($i = 10; $i < 13; $i++) {
14        yield $i;
15    }
16}
17
18function fooResults() {
19    yield 0;
20    yield 1;
21    yield from barResults();
22    yield 42;
23}
24
25function doSomething() {
26    $generator = fooResults();
27    foreach ($generator as $value) {
28        echo $value . PHP_EOL;
29    }
30
31    return 'Done';
32}
33
34echo doSomething() . PHP_EOL;
35?>
36--EXPECTF--
37<!-- init '%s%eobserver_generator_%d.php' -->
38<file '%s%eobserver_generator_%d.php'>
39  <!-- init doSomething() -->
40  <doSomething>
41    <!-- init fooResults() -->
42    <fooResults>
43    </fooResults:0>
440
45    <fooResults>
46    </fooResults:1>
471
48    <fooResults>
49    </fooResults:1>
50    <!-- init barResults() -->
51    <barResults>
52    </barResults:10>
5310
54    <barResults>
55    </barResults:11>
5611
57    <barResults>
58    </barResults:12>
5912
60    <barResults>
61    </barResults:NULL>
62    <fooResults>
63    </fooResults:42>
6442
65    <fooResults>
66    </fooResults:NULL>
67  </doSomething:'Done'>
68Done
69</file '%s%eobserver_generator_%d.php'>
70