1--TEST--
2Yield can be used in nested method calls
3--FILE--
4<?php
5
6class A {
7    function foo() {
8        echo "Called A::foo\n";
9    }
10}
11
12class B {
13    function foo() {
14        echo "Called B::foo\n";
15    }
16}
17
18function gen($obj) {
19    $obj->foo($obj->foo(yield));
20}
21
22$g1 = gen(new A);
23$g1->current();
24
25$g2 = gen(new B);
26$g2->current();
27
28$g1->next();
29$g2->next();
30
31?>
32--EXPECT--
33Called A::foo
34Called A::foo
35Called B::foo
36Called B::foo
37