Skip to content

Commit 52490bb

Browse files
committed
Revert "Throw notice on param name mismatch"
This reverts commit 0a8cbb9739fde2734b3cb9c23bcdeb3ecec5243c.
1 parent 1468d2a commit 52490bb

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

Zend/zend_inheritance.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -516,18 +516,6 @@ static inheritance_status zend_do_perform_arg_type_hint_check(
516516
}
517517
/* }}} */
518518

519-
static const char *get_arg_name(
520-
const zend_function *fe, const zend_arg_info *arg_info, size_t *len) {
521-
if (fe->type == ZEND_INTERNAL_FUNCTION) {
522-
zend_internal_arg_info *internal_arg_info = (zend_internal_arg_info *) arg_info;
523-
*len = strlen(internal_arg_info->name);
524-
return internal_arg_info->name;
525-
} else {
526-
*len = ZSTR_LEN(arg_info->name);
527-
return ZSTR_VAL(arg_info->name);
528-
}
529-
}
530-
531519
static inheritance_status zend_do_perform_implementation_check(
532520
const zend_function *fe, const zend_function *proto) /* {{{ */
533521
{
@@ -604,20 +592,6 @@ static inheritance_status zend_do_perform_implementation_check(
604592
if (ZEND_ARG_SEND_MODE(fe_arg_info) != ZEND_ARG_SEND_MODE(proto_arg_info)) {
605593
return INHERITANCE_ERROR;
606594
}
607-
608-
// TODO: We may get duplicate errors for UNRESOLVED.
609-
size_t proto_name_len, fe_name_len;
610-
const char *proto_name = get_arg_name(proto, proto_arg_info, &proto_name_len);
611-
const char *fe_name = get_arg_name(fe, fe_arg_info, &fe_name_len);
612-
if (proto_name_len != fe_name_len || memcmp(proto_name, fe_name, proto_name_len)) {
613-
zend_error(E_NOTICE,
614-
"Parameter $%s of %s::%s() has been renamed to $%s in %s::%s(), "
615-
"which may break named parameters",
616-
proto_name,
617-
ZSTR_VAL(proto->common.scope->name), ZSTR_VAL(proto->common.function_name),
618-
fe_name,
619-
ZSTR_VAL(fe->common.scope->name), ZSTR_VAL(fe->common.function_name));
620-
}
621595
}
622596

623597
/* Check return type compatibility, but only if the prototype already specifies

0 commit comments

Comments
 (0)