php-src/ext/spl/tests/spl_007.phpt
Johannes Schlüter e181e3ac7b - MFH Fix "f" modifier for zend_parse_parameters_ex in case of a __call call
# only affects iterator_apply() in 5_2 branch
2007-04-30 19:54:41 +00:00

27 lines
448 B
PHP
Executable File

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