1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 18:53:33 +02:00
Files
archived-php-src/Zend/tests/generators/generator_trampoline.phpt
T
2016-11-28 12:20:19 +03:00

25 lines
318 B
PHP

--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)