if (reg_function->common.arg_info && reg_function->common.num_args) {
uint32_t i;
for (i = 0; i < reg_function->common.num_args; i++) {
- if (ZEND_TYPE_IS_SET(reg_function->common.arg_info[i].type)) {
+ zend_arg_info *arg_info = ®_function->common.arg_info[i];
+ ZEND_ASSERT(arg_info->name && "Parameter must have a name");
+ if (ZEND_TYPE_IS_SET(arg_info->type)) {
reg_function->common.fn_flags |= ZEND_ACC_HAS_TYPE_HINTS;
- break;
}
}
}
}
smart_str_appendc(&str, '$');
-
- if (arg_info->name) {
- if (fptr->type == ZEND_INTERNAL_FUNCTION) {
- smart_str_appends(&str, ((zend_internal_arg_info*)arg_info)->name);
- } else {
- smart_str_appendl(&str, ZSTR_VAL(arg_info->name), ZSTR_LEN(arg_info->name));
- }
+ if (fptr->type == ZEND_INTERNAL_FUNCTION) {
+ smart_str_appends(&str, ((zend_internal_arg_info*)arg_info)->name);
} else {
- smart_str_appends(&str, "param");
- smart_str_append_unsigned(&str, i);
+ smart_str_appendl(&str, ZSTR_VAL(arg_info->name), ZSTR_LEN(arg_info->name));
}
if (i >= required && !ZEND_ARG_IS_VARIADIC(arg_info)) {
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) {