diff options
| author | Christopher Jones <sixd@php.net> | 2013-09-26 09:57:54 -0700 |
|---|---|---|
| committer | Christopher Jones <sixd@php.net> | 2013-09-26 09:57:54 -0700 |
| commit | eb8e63bd3cfdbd6ad537dbea5f001c0a1995a40d (patch) | |
| tree | 1317a8a47c0e4bd1193c8fbf705d91ae75140f78 /Zend/zend_execute.c | |
| parent | c02ff01548bb27cb82f46975869b859c4cf98e4b (diff) | |
| parent | 0d7a6388663b76ebed6585ac92dfca5ef65fa7af (diff) | |
| download | php-git-eb8e63bd3cfdbd6ad537dbea5f001c0a1995a40d.tar.gz | |
Merge branch 'master' of https://git.php.net/repository/php-src
* 'master' of https://git.php.net/repository/php-src:
Implement variadic function syntax
Diffstat (limited to 'Zend/zend_execute.c')
| -rw-r--r-- | Zend/zend_execute.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index c79a55169c..9f78218d3d 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -616,12 +616,17 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva char *need_msg; zend_class_entry *ce; - if (!zf->common.arg_info - || arg_num>zf->common.num_args) { + if (!zf->common.arg_info) { return 1; } - cur_arg_info = &zf->common.arg_info[arg_num-1]; + if (arg_num <= zf->common.num_args) { + cur_arg_info = &zf->common.arg_info[arg_num-1]; + } else if (zf->common.fn_flags & ZEND_ACC_VARIADIC) { + cur_arg_info = &zf->common.arg_info[zf->common.num_args-1]; + } else { + return 1; + } if (cur_arg_info->class_name) { const char *class_name; |
