summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2004-02-25 14:56:45 +0000
committerZeev Suraski <zeev@php.net>2004-02-25 14:56:45 +0000
commit7086634a0bcb48d47ad34ca36c188f379d367924 (patch)
treed2fdb56dabde6ed739c7424bfad4fcee46dc7990 /Zend/zend_API.c
parentab968b3d032771977f14d9353c18549899a57dec (diff)
downloadphp-git-7086634a0bcb48d47ad34ca36c188f379d367924.tar.gz
- Improve ARG_INFO() macros to support supplying required_num_args
- Initial fix for foreach($o->mthd()->arr) crash (now leaks)
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 90c12fa826..ea5534ac51 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -1221,7 +1221,11 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
internal_function->arg_info = ptr->arg_info+1;
internal_function->num_args = ptr->num_args;
/* Currently you cannot denote that the function can accept less arguments than num_args */
- internal_function->required_num_args = ptr->num_args;
+ if (ptr->arg_info[0].required_num_args == -1) {
+ internal_function->required_num_args = ptr->num_args;
+ } else {
+ internal_function->required_num_args = ptr->arg_info[0].required_num_args;
+ }
internal_function->pass_rest_by_reference = ptr->arg_info[0].pass_by_reference;
internal_function->return_reference = ptr->arg_info[0].return_reference;
} else {