xref: /PHP-7.4/ext/spl/tests/spl_007.phpt (revision 610c7fbe)
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===DONE===
19<?php exit(0); ?>
20--EXPECT--
21Called foobar.
22Called foobar.
23Called foobar.
24===DONE===
25