1--TEST--
2Observer: Unused retvals from generators are still observable
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 foo() {
13    yield 'I should be observable';
14    yield 'Me too!';
15}
16
17$gen = foo();
18$gen->current();
19$gen->next();
20$gen->current();
21
22echo 'Done' . PHP_EOL;
23?>
24--EXPECTF--
25<!-- init '%s' -->
26<file '%s'>
27  <!-- init Generator::current() -->
28  <Generator::current>
29    <!-- init foo() -->
30    <foo>
31    </foo:'I should be observable'>
32  </Generator::current:'I should be observable'>
33  <!-- init Generator::next() -->
34  <Generator::next>
35    <foo>
36    </foo:'Me too!'>
37  </Generator::next:NULL>
38  <Generator::current>
39  </Generator::current:'Me too!'>
40Done
41</file '%s'>
42