1--TEST-- 2Yield can be used during a method call 3--FILE-- 4<?php 5 6class A { 7 public function b($c) { 8 echo $c, "\n"; 9 } 10} 11 12function gen() { 13 $a = new A; 14 $a->b(yield); 15} 16 17$gen = gen(); 18$gen->send('foo'); 19 20// test resource cleanup 21$gen = gen(); 22$gen->rewind(); 23unset($gen); 24 25?> 26--EXPECT-- 27foo 28