diff options
| author | Dmitry Stogov <dmitry@zend.com> | 2014-12-22 16:44:39 +0300 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@zend.com> | 2014-12-22 16:44:39 +0300 |
| commit | 2646f7bcb98dcdd322ea21701c8bb101104ea619 (patch) | |
| tree | 6cfa66ba666378de3c59759079e17f3245af0281 /Zend/zend_compile.c | |
| parent | 2bc63e7b6d348e9210ec09facb4bedb6f4ab921a (diff) | |
| download | php-git-2646f7bcb98dcdd322ea21701c8bb101104ea619.tar.gz | |
Don't count variadic argument in zend_func.common.num_args. This allows faster CALL/RETURN code.
Diffstat (limited to 'Zend/zend_compile.c')
| -rw-r--r-- | Zend/zend_compile.c | 5 |
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--; + } } /* }}} */ |
