1--TEST--
2Observer: Generator with explicit return
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    return 1337;
17}
18
19function doSomething() {
20    $generator = getResults();
21    foreach ($generator as $value) {
22        echo $value . PHP_EOL;
23    }
24    echo $generator->getReturn() . PHP_EOL;
25
26    return 'Done';
27}
28
29echo doSomething() . PHP_EOL;
30?>
31--EXPECTF--
32<!-- init '%s' -->
33<file '%s'>
34  <!-- init doSomething() -->
35  <doSomething>
36    <!-- init getResults() -->
37    <getResults>
38    </getResults:10>
3910
40    <getResults>
41    </getResults:11>
4211
43    <getResults>
44    </getResults:12>
4512
46    <getResults>
47    </getResults:1337>
48    <!-- init Generator::getReturn() -->
49    <Generator::getReturn>
50    </Generator::getReturn:1337>
511337
52  </doSomething:'Done'>
53Done
54</file '%s'>
55