Skip to content

Commit ab353a5

Browse files
committed
Don't handle unnamed arg in closure debug info
Since PHP 8, we should no longer have any unnamed arguments. Don't check for this case.
1 parent 232aa34 commit ab353a5

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

Zend/zend_closures.c

+7-12
Original file line numberDiff line numberDiff line change
@@ -561,20 +561,15 @@ static HashTable *zend_closure_get_debug_info(zend_object *object, int *is_temp)
561561
for (i = 0; i < num_args; i++) {
562562
zend_string *name;
563563
zval info;
564-
if (arg_info->name) {
565-
if (zstr_args) {
566-
name = zend_strpprintf(0, "%s$%s",
567-
ZEND_ARG_SEND_MODE(arg_info) ? "&" : "",
568-
ZSTR_VAL(arg_info->name));
569-
} else {
570-
name = zend_strpprintf(0, "%s$%s",
571-
ZEND_ARG_SEND_MODE(arg_info) ? "&" : "",
572-
((zend_internal_arg_info*)arg_info)->name);
573-
}
564+
ZEND_ASSERT(arg_info->name && "Argument should have name");
565+
if (zstr_args) {
566+
name = zend_strpprintf(0, "%s$%s",
567+
ZEND_ARG_SEND_MODE(arg_info) ? "&" : "",
568+
ZSTR_VAL(arg_info->name));
574569
} else {
575-
name = zend_strpprintf(0, "%s$param%d",
570+
name = zend_strpprintf(0, "%s$%s",
576571
ZEND_ARG_SEND_MODE(arg_info) ? "&" : "",
577-
i + 1);
572+
((zend_internal_arg_info*)arg_info)->name);
578573
}
579574
ZVAL_NEW_STR(&info, zend_strpprintf(0, "%s", i >= required ? "<optional>" : "<required>"));
580575
zend_hash_update(Z_ARRVAL(val), name, &info);

0 commit comments

Comments
 (0)