summaryrefslogtreecommitdiff
path: root/Zend/tests/generators/clone_with_stack.phpt
blob: 5a8e6d842ca8e4f6a4dd6617314def0409d0b017 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--TEST--
A generator with an active stack can be cloned
--FILE--
<?php

function gen() {
    var_dump(str_repeat("x", yield));
}

$g1 = gen();
$g1->rewind();
$g2 = clone $g1;
unset($g1);
$g2->send(10);

?>
--EXPECT--
string(10) "xxxxxxxxxx"