12ab7dec1cbf35f3d901fec94c64a24863d415c3
[yaffs-website] / vendor / nikic / php-parser / test / code / prettyPrinter / expr / yield.test
1 Yield
2 -----
3 <?php
4
5 function gen()
6 {
7     yield;
8     yield $a;
9     yield $a => $b;
10     $a = yield;
11     $a = (yield $b);
12     $a = (yield $b => $c);
13 }
14 // TODO Get rid of parens for cases 2 and 3
15 -----
16 function gen()
17 {
18     yield;
19     (yield $a);
20     (yield $a => $b);
21     $a = yield;
22     $a = (yield $b);
23     $a = (yield $b => $c);
24 }
25 // TODO Get rid of parens for cases 2 and 3
26 -----
27 <?php
28
29 function gen()
30 {
31     $a = yield $b;
32     $a = yield $b => $c;
33     yield from $a;
34     $a = yield from $b;
35 }
36 // TODO Get rid of parens for last case
37 -----
38 !!php7
39 function gen()
40 {
41     $a = (yield $b);
42     $a = (yield $b => $c);
43     yield from $a;
44     $a = (yield from $b);
45 }
46 // TODO Get rid of parens for last case