Skip to content

Commit

Permalink
Don't handle unnamed arg in closure debug info
Browse files Browse the repository at this point in the history
Since PHP 8, we should no longer have any unnamed arguments.
Don't check for this case.
  • Loading branch information
nikic committed Jul 9, 2021
1 parent 232aa34 commit ab353a5
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions Zend/zend_closures.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,20 +561,15 @@ static HashTable *zend_closure_get_debug_info(zend_object *object, int *is_temp)
for (i = 0; i < num_args; i++) {
zend_string *name;
zval info;
if (arg_info->name) {
if (zstr_args) {
name = zend_strpprintf(0, "%s$%s",
ZEND_ARG_SEND_MODE(arg_info) ? "&" : "",
ZSTR_VAL(arg_info->name));
} else {
name = zend_strpprintf(0, "%s$%s",
ZEND_ARG_SEND_MODE(arg_info) ? "&" : "",
((zend_internal_arg_info*)arg_info)->name);
}
ZEND_ASSERT(arg_info->name && "Argument should have name");
if (zstr_args) {
name = zend_strpprintf(0, "%s$%s",
ZEND_ARG_SEND_MODE(arg_info) ? "&" : "",
ZSTR_VAL(arg_info->name));
} else {
name = zend_strpprintf(0, "%s$param%d",
name = zend_strpprintf(0, "%s$%s",
ZEND_ARG_SEND_MODE(arg_info) ? "&" : "",
i + 1);
((zend_internal_arg_info*)arg_info)->name);
}
ZVAL_NEW_STR(&info, zend_strpprintf(0, "%s", i >= required ? "<optional>" : "<required>"));
zend_hash_update(Z_ARRVAL(val), name, &info);
Expand Down

0 comments on commit ab353a5

Please sign in to comment.