mirror of
https://github.com/php/php-src.git
synced 2024-10-20 07:53:58 +00:00
27 lines
448 B
Plaintext
27 lines
448 B
Plaintext
|
--TEST--
|
||
|
SPL: iterator_apply() with callback using __call()
|
||
|
--SKIPIF--
|
||
|
<?php if (!extension_loaded("spl")) print "skip"; ?>
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
class Foo {
|
||
|
public function __call($name, $params) {
|
||
|
echo "Called $name.\n";
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
$it = new ArrayIterator(array(1, 2, 3));
|
||
|
|
||
|
iterator_apply($it, array(new Foo, "foobar"));
|
||
|
|
||
|
?>
|
||
|
===DONE===
|
||
|
<?php exit(0); ?>
|
||
|
--EXPECT--
|
||
|
Called foobar.
|
||
|
Called foobar.
|
||
|
Called foobar.
|
||
|
===DONE===
|