diff options
Diffstat (limited to 'Zend/tests/generators/generator_trampoline.phpt')
| -rw-r--r-- | Zend/tests/generators/generator_trampoline.phpt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Zend/tests/generators/generator_trampoline.phpt b/Zend/tests/generators/generator_trampoline.phpt new file mode 100644 index 0000000000..a98dc9ee49 --- /dev/null +++ b/Zend/tests/generators/generator_trampoline.phpt @@ -0,0 +1,24 @@ +--TEST-- +Calling generator through magic __call() +--FILE-- +<?php +class A { + public function __call($name, $args) { + for ($i = 0; $i < 5; $i++) { + yield $i; + } + } +} + +$a = new A(); +foreach ($a->gen() as $n) { + var_dump($n); +} +$a->gen(); +?> +--EXPECT-- +int(0) +int(1) +int(2) +int(3) +int(4) |
