summaryrefslogtreecommitdiff
path: root/Zend/tests/generators/yield_without_value.phpt
blob: 52292b737c75d530a3bf5e09338e8085b8e351b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--TEST--
yield can be used without a value
--FILE--
<?php

function recv() {
    while (true) {
        var_dump(yield);
    }
}

$receiver = recv();
var_dump($receiver->current());
$receiver->send(1);
var_dump($receiver->current());
$receiver->send(2);
var_dump($receiver->current());
$receiver->send(3);

?>
--EXPECT--
NULL
int(1)
NULL
int(2)
NULL
int(3)