PageRenderTime 37ms CodeModel.GetById 33ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/hphp/test/slow/yield/2164.php

http://github.com/facebook/hiphop-php
PHP | 35 lines | 33 code | 2 blank | 0 comment | 0 complexity | f7f6e8b2fbe46a203a4984b0a2ada145 MD5 | raw file
 1<?php
 2
 3function f($x, $y) {
 4  yield $x;
 5
 6  yield $$y;
 7}
 8foreach (f(10, 'x') as $x) {
 9 var_dump($x);
10 }
11function g() {
12  extract(func_get_args(), EXTR_PREFIX_ALL, 'foo');
13  yield $foo_0;
14  yield $foo_1;
15}
16foreach (g('hello', 'world') as $x) {
17 var_dump($x);
18 }
19function h($x, $y) {
20  $z = 16;
21  $arr = compact('x', 'y', 'z');
22  yield $arr['z'];
23  yield $arr['x'];
24  yield $arr['y'];
25}
26foreach (h(32, 64) as $x) {
27 var_dump($x);
28 }
29function i($x, $y) {
30  $arr = compact($x);
31  yield $arr[$x];
32}
33foreach (i('y', 32) as $x) {
34 var_dump($x);
35 }