xref: /php-src/ext/spl/tests/spl_007.phpt (revision a555cc0b)
1--TEST--
2SPL: iterator_apply() with callback using __call()
3--FILE--
4<?php
5
6class Foo {
7    public function __call($name, $params) {
8        echo "Called $name.\n";
9        return true;
10    }
11}
12
13$it = new ArrayIterator(array(1, 2, 3));
14
15iterator_apply($it, array(new Foo, "foobar"));
16
17?>
18--EXPECT--
19Called foobar.
20Called foobar.
21Called foobar.
22