source: src/router/php7/Zend/tests/generators/generator_trampoline.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 2 months ago

update php

File size: 318 bytes
Line 
1--TEST--
2Calling generator through magic __call()
3--FILE--
4<?php
5class A {
6    public function __call($name, $args) {
7        for ($i = 0; $i < 5; $i++) {
8            yield $i;
9        }
10    }
11}
12
13$a = new A();
14foreach ($a->gen() as $n) {
15    var_dump($n);
16}
17$a->gen();
18?>
19--EXPECT--
20int(0)
21int(1)
22int(2)
23int(3)
24int(4)
Note: See TracBrowser for help on using the repository browser.