global statement removal: hphp/test [7/x]
[hiphop-php.git] / hphp / test / quick / closure_gen.php
blob8cdfd7385693aa63aa56d609aa7998251de940f6
1 <?hh
3 function using_($cgen) {
4 foreach ($cgen() as $x) {
5 yield $x;
9 function broke() {
10 foreach (using_(function() { yield 1; yield 2; yield 3; }) as $x) {
11 var_dump($x);
14 broke();
16 class c {
17 function genclo() {
18 return function() {
19 yield $this;
24 function main() {
25 $c = new c;
26 $f = $c->genclo();
27 foreach ($f() as $v) {
28 var_dump($v);
31 main();