summaryrefslogtreecommitdiff
path: root/Zend/tests/generators/yield_during_method_call.phpt
blob: 3a9914d58b7547037af189187f1e9717ce8e80b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--TEST--
Yield can be used during a method call
--FILE--
<?php

class A {
    public function b($c) {
        echo $c, "\n";
    }
}

function gen() {
    $a = new A;
    $a->b(yield);
}

$gen = gen();
$gen->send('foo');

// test resource cleanup
$gen = gen();
$gen->rewind();
unset($gen);

?>
--EXPECT--
foo