summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index c159fcc6e1..7c323def84 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -3884,6 +3884,11 @@ void zend_compile_params(zend_ast *ast) /* {{{ */
/* These are assigned at the end to avoid unitialized memory in case of an error */
op_array->num_args = list->children;
op_array->arg_info = arg_infos;
+
+ /* Don't count the variadic argument */
+ if (op_array->fn_flags & ZEND_ACC_VARIADIC) {
+ op_array->num_args--;
+ }
}
/* }}} */