summaryrefslogtreecommitdiff
path: root/ext/reflection
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-04-07 16:05:33 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-04-07 16:05:33 +0200
commitc81cf1c7af886161628ac4360cb5e5bfd94500fd (patch)
tree8df44446274f6d78e5872998c86e35da0343d950 /ext/reflection
parent68139dbdd89451ae804548b9726400a96aeec4fd (diff)
downloadphp-git-c81cf1c7af886161628ac4360cb5e5bfd94500fd.tar.gz
Assert that arginfo parameter name is present
Diffstat (limited to 'ext/reflection')
-rw-r--r--ext/reflection/php_reflection.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 278e565874..e9993e9feb 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -638,15 +638,12 @@ static void _parameter_string(smart_str *str, zend_function *fptr, struct _zend_
if (ZEND_ARG_IS_VARIADIC(arg_info)) {
smart_str_appends(str, "...");
}
- if (arg_info->name) {
- smart_str_append_printf(str, "$%s",
- (fptr->type == ZEND_INTERNAL_FUNCTION &&
- !(fptr->common.fn_flags & ZEND_ACC_USER_ARG_INFO)) ?
- ((zend_internal_arg_info*)arg_info)->name :
- ZSTR_VAL(arg_info->name));
- } else {
- smart_str_append_printf(str, "$param%d", offset);
- }
+ smart_str_append_printf(str, "$%s",
+ (fptr->type == ZEND_INTERNAL_FUNCTION &&
+ !(fptr->common.fn_flags & ZEND_ACC_USER_ARG_INFO)) ?
+ ((zend_internal_arg_info*)arg_info)->name :
+ ZSTR_VAL(arg_info->name));
+
if (fptr->type == ZEND_USER_FUNCTION && !required) {
zend_op *precv = _get_recv_op((zend_op_array*)fptr, offset);
if (precv && precv->opcode == ZEND_RECV_INIT && precv->op2_type != IS_UNUSED) {