From: Johannes Schlüter Date: Mon, 30 Apr 2007 19:54:41 +0000 (+0000) Subject: - MFH Fix "f" modifier for zend_parse_parameters_ex in case of a __call call X-Git-Tag: php-5.2.2~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e181e3ac7bdf1439b142c17dec6be2b76b776c76;p=php - MFH Fix "f" modifier for zend_parse_parameters_ex in case of a __call call # only affects iterator_apply() in 5_2 branch --- diff --git a/Zend/zend_API.c b/Zend/zend_API.c index ad58ac4490..724c6137d3 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2361,17 +2361,24 @@ ZEND_API int zend_fcall_info_init(zval *callable, zend_fcall_info *fci, zend_fca fci->size = sizeof(*fci); fci->function_table = ce ? &ce->function_table : EG(function_table); fci->object_pp = obj; - fci->function_name = NULL; + fci->function_name = callable; fci->retval_ptr_ptr = NULL; fci->param_count = 0; fci->params = NULL; fci->no_separation = 1; fci->symbol_table = NULL; - fcc->initialized = 1; - fcc->function_handler = func; - fcc->calling_scope = ce; - fcc->object_pp = obj; + if (strlen(func->common.function_name) == sizeof(ZEND_CALL_FUNC_NAME) - 1 && !memcmp(func->common.function_name, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME))) { + fcc->initialized = 0; + fcc->function_handler = NULL; + fcc->calling_scope = NULL; + fcc->object_pp = NULL; + } else { + fcc->initialized = 1; + fcc->function_handler = func; + fcc->calling_scope = ce; + fcc->object_pp = obj; + } return SUCCESS; } 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-- + +--FILE-- + +===DONE=== + +--EXPECT-- +Called foobar. +Called foobar. +Called foobar. +===DONE===