summaryrefslogtreecommitdiff
path: root/ext/spl
diff options
context:
space:
mode:
authorJohannes Schlüter <johannes@php.net>2007-04-30 19:54:41 +0000
committerJohannes Schlüter <johannes@php.net>2007-04-30 19:54:41 +0000
commite181e3ac7bdf1439b142c17dec6be2b76b776c76 (patch)
tree1758d058223832a9eea34301cfeeb57b37c40c1a /ext/spl
parent618e172ec86d30891c75cd5d8a8b7b0e25e99784 (diff)
downloadphp-git-e181e3ac7bdf1439b142c17dec6be2b76b776c76.tar.gz
- MFH Fix "f" modifier for zend_parse_parameters_ex in case of a __call call
# only affects iterator_apply() in 5_2 branch
Diffstat (limited to 'ext/spl')
-rwxr-xr-xext/spl/tests/spl_007.phpt26
1 files changed, 26 insertions, 0 deletions
diff --git a/ext/spl/tests/spl_007.phpt b/ext/spl/tests/spl_007.phpt
new file mode 100755
index 0000000000..dcd63f9b5a
--- /dev/null
+++ b/ext/spl/tests/spl_007.phpt
@@ -0,0 +1,26 @@
+--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===