1--TEST-- 2Observer: Generator with 'yield from' 3--SKIPIF-- 4<?php if (!extension_loaded('zend-test')) die('skip: zend-test extension required'); ?> 5--INI-- 6zend_test.observer.enabled=1 7zend_test.observer.observe_all=1 8zend_test.observer.show_return_value=1 9--FILE-- 10<?php 11function barResults() { 12 for ($i = 10; $i < 13; $i++) { 13 yield $i; 14 } 15} 16 17function fooResults() { 18 yield 0; 19 yield 1; 20 yield from barResults(); 21 yield 42; 22} 23 24function doSomething() { 25 $generator = fooResults(); 26 foreach ($generator as $value) { 27 echo $value . PHP_EOL; 28 } 29 30 return 'Done'; 31} 32 33echo doSomething() . PHP_EOL; 34?> 35--EXPECTF-- 36<!-- init '%s%eobserver_generator_%d.php' --> 37<file '%s%eobserver_generator_%d.php'> 38 <!-- init doSomething() --> 39 <doSomething> 40 <!-- init fooResults() --> 41 <fooResults> 42 </fooResults:0> 430 44 <fooResults> 45 </fooResults:1> 461 47 <fooResults> 48 </fooResults:1> 49 <!-- init barResults() --> 50 <barResults> 51 </barResults:10> 5210 53 <barResults> 54 </barResults:11> 5511 56 <barResults> 57 </barResults:12> 5812 59 <barResults> 60 </barResults:NULL> 61 <fooResults> 62 </fooResults:42> 6342 64 <fooResults> 65 </fooResults:NULL> 66 </doSomething:'Done'> 67Done 68</file '%s%eobserver_generator_%d.php'> 69