summaryrefslogtreecommitdiff
path: root/Zend/tests/generators/generator_send.phpt
blob: 074d815389711117d91868df1b4d9a1d64a82e98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--TEST--
Values can be sent back to the generator
--FILE--
<?php

function gen() {
    var_dump(yield "yield foo");
    var_dump(yield "yield bar");
}

$gen = gen();
var_dump($gen->current());
$gen->send("send bar");
var_dump($gen->current());
$gen->send("send foo");

?>
--EXPECT--
string(9) "yield foo"
string(8) "send bar"
string(9) "yield bar"
string(8) "send foo"