Home
last modified time | relevance | path

Searched refs:yield (Results 1 – 25 of 154) sorted by relevance

1234567

/PHP-7.0/Zend/tests/generators/
H A Dyield_in_parenthesis.phpt2 No additional parenthesis are required around yield if they are already present
7 if (yield $foo); elseif (yield $foo);
8 if (yield $foo): elseif (yield $foo): endif;
9 while (yield $foo);
10 do {} while (yield $foo);
11 switch (yield $foo) {}
12 (yield $foo);
13 die(yield $foo);
14 func(yield $foo);
15 $foo->func(yield $foo);
[all …]
H A Dyield_precedence.phpt2 Precedence of yield and arrow operators
7 yield "a" . "b";
8 yield "a" or die;
9 yield "k" => "a" . "b";
10 yield "k" => "a" or die;
11 var_dump([yield "k" => "a" . "b"]);
12 yield yield "k1" => yield "k2" => "a" . "b";
13 yield yield "k1" => (yield "k2") => "a" . "b";
14 var_dump([yield "k1" => yield "k2" => "a" . "b"]);
15 var_dump([yield "k1" => (yield "k2") => "a" . "b"]);
H A Dgenerator_rewind.phpt2 A generator can only be rewinded before or at the first yield
7 echo "before yield\n";
8 yield;
9 echo "after yield\n";
10 yield;
26 yield $foo;
27 yield $foo;
41 if (false) yield;
49 before yield
50 after yield
H A Drecursive_yield_from.phpt2 Check if recursion with yield from works
7 yield 1 + $a;
9 yield from from($a + 3);
10 yield from from($a + 6);
12 yield 2 + $a;
16 yield from from();
H A Dgenerator_send.phpt7 var_dump(yield "yield foo");
8 var_dump(yield "yield bar");
19 string(9) "yield foo"
21 string(9) "yield bar"
H A Dyield_in_finally.phpt2 yield can be used in finally (apart from forced closes)
12 echo "before yield\n";
13 yield "yielded value";
14 echo "after yield\n";
27 before yield
29 after yield
H A Dyield_from_array.phpt6 yield 0;
7 yield from []; // must not yield anything
8 yield from [1,2];
12 yield from from();
H A Dbasic_yield_from_proxying.phpt2 Basic test if yield from works
6 yield "from" => 1;
7 yield 2;
11 yield "gen" => 0;
12 yield from from();
13 yield 3;
H A Dyield_from_deep_recursion.phpt2 Deep recursion with yield from
8 yield $i;
13 yield from gen(++$i);
15 yield $i;
16 yield from from(++$i);
H A Dgenerator_with_nonscalar_keys.phpt7 yield [1, 2, 3] => [4, 5, 6];
8 yield (object) ['a' => 'b'] => (object) ['b' => 'a'];
9 yield 3.14 => 2.73;
10 yield false => true;
11 yield true => false;
12 yield null => null;
H A Dmultiple_yield_from_on_same_generator.phpt2 Multiple yield from on a same Generator instance
7 yield 1 + $a;
9 var_dump(yield from gen($a + 1));
11 yield 3 + $a;
16 var_dump(yield from $gen);
19 /* Twice a Generator from bar() using yield from on $gen */
H A Dyield_from_iterator.phpt2 yield from with an (Array)Iterator
6 yield 1;
7 yield from new ArrayIterator([2, 3, 4]);
8 yield 5;
H A Dyield_from_greedy_parse.phpt2 yield from parses too greedily
11 yield 24;
15 yield from1234(42);
16 yield from(bar());
H A Dauto_incrementing_keys.phpt7 yield 'foo';
8 yield 'bar';
9 yield 5 => 'rab';
10 yield 'oof';
H A Dyield_from_force_closed.phpt2 Cannot "yield from" from force closed generator
8 yield 1;
14 yield from gen1();
17 yield from gen1();
34 Error: Cannot use "yield from" in a force-closed generator in %s:%d
H A Ddangling_send_target.phpt6 yield from [yield];
13 $x = yield;
14 yield from [1, 2, 3];
H A Dget_return_types.phpt8 yield;
16 yield;
24 yield;
32 yield;
40 yield;
H A Dgenerator_in_multipleiterator.phpt7 yield 'a';
8 yield 'aa';
12 yield 'b';
13 yield 'bb';
H A Dgenerator_return_without_value.phpt7 yield;
12 yield;
18 yield;
23 yield;
H A Dthrow_caught.phpt7 echo "before yield\n";
9 yield;
14 yield 'result';
22 before yield
H A Dyield_unary_precedence.phpt2 When + or - are used on yield, they must be unary (and not binary) (Bug #69160)
6 var_dump(yield +1);
7 var_dump(yield -1);
8 var_dump(yield * -1); // other ops still should behave normally
H A Dget_return.phpt8 yield 24;
16 yield 24;
25 // & for generators specifies by-reference yield, not return
29 yield $var;
41 yield 24;
52 yield 24;
64 yield 24;
/PHP-7.0/Zend/tests/generators/errors/
H A Dyield_in_force_closed_finally_error.phpt2 yield cannot be used in a finally block when the generator is force-closed
8 echo "before yield\n";
9 yield;
10 echo "after yield\n";
12 echo "before yield in finally\n";
13 yield;
14 echo "after yield in finally\n";
26 before yield
27 before yield in finally
29 Fatal error: Uncaught Error: Cannot yield from finally in a force-closed generator in %s:%d
/PHP-7.0/ext/spl/tests/
H A Diterator_to_array_nonscalar_keys.phpt7 yield "foo" => 0;
8 yield 1 => 1;
9 yield 2.5 => 2;
10 yield null => 3;
11 yield [] => 4;
12 yield new stdClass => 5;
/PHP-7.0/Zend/tests/generators/finally/
H A Dyield_yield.phpt2 Try { yield } finally { yield }
9 yield "2";
13 yield "5";

Completed in 33 milliseconds

1234567