1--TEST--
2Observer: Basic generator observability
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 getResults() {
13    for ($i = 10; $i < 13; $i++) {
14        yield $i;
15    }
16}
17
18function doSomething() {
19    $generator = getResults();
20    foreach ($generator as $value) {
21        echo $value . PHP_EOL;
22    }
23
24    return 'Done';
25}
26
27echo doSomething() . PHP_EOL;
28?>
29--EXPECTF--
30<!-- init '%s%eobserver_generator_%d.php' -->
31<file '%s%eobserver_generator_%d.php'>
32  <!-- init doSomething() -->
33  <doSomething>
34    <!-- init getResults() -->
35    <getResults>
36    </getResults:10>
3710
38    <getResults>
39    </getResults:11>
4011
41    <getResults>
42    </getResults:12>
4312
44    <getResults>
45    </getResults:NULL>
46  </doSomething:'Done'>
47Done
48</file '%s%eobserver_generator_%d.php'>
49