summaryrefslogtreecommitdiff
path: root/Zend/zend_inheritance.c
diff options
context:
space:
mode:
authorJoe Watkins <krakjoe@php.net>2016-03-29 09:36:08 +0100
committerJoe Watkins <krakjoe@php.net>2016-03-29 09:36:08 +0100
commit3f56dfe8660b45c72dee7adcd856dd9a7049cf5b (patch)
tree00c8838ae8553e70a4a03eac49f1c6c12b0c5991 /Zend/zend_inheritance.c
parentee9a78a033696ff9546fb1dbfecd28f20477b511 (diff)
downloadphp-git-3f56dfe8660b45c72dee7adcd856dd9a7049cf5b.tar.gz
Bug #71428 work ... hopefully, fix drupal 8
Diffstat (limited to 'Zend/zend_inheritance.c')
-rw-r--r--Zend/zend_inheritance.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index d904a587a1..b52f45487c 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -167,7 +167,7 @@ char *zend_visibility_string(uint32_t fn_flags) /* {{{ */
}
/* }}} */
-static int zend_do_perform_type_hint_check(const zend_function *fe, zend_arg_info *fe_arg_info, const zend_function *proto, zend_arg_info *proto_arg_info) /* {{{ */
+static int zend_do_perform_type_hint_check(const zend_function *fe, uint32_t arg_num, zend_arg_info *fe_arg_info, const zend_function *proto, zend_arg_info *proto_arg_info) /* {{{ */
{
if (ZEND_LOG_XOR(fe_arg_info->class_name, proto_arg_info->class_name)) {
/* Only one has a type declaration and the other one doesn't */
@@ -238,13 +238,13 @@ static int zend_do_perform_type_hint_check(const zend_function *fe, zend_arg_inf
zend_string_release(fe_class_name);
}
- if (proto_arg_info->allow_null && !fe_arg_info->allow_null) {
- /* incompatible nullability */
+ if (fe_arg_info->type_hint != proto_arg_info->type_hint) {
+ /* Incompatible type */
return 0;
}
- if (fe_arg_info->type_hint != proto_arg_info->type_hint) {
- /* Incompatible type */
+ if (proto_arg_info->type_hint && proto_arg_info->allow_null && !fe_arg_info->allow_null) {
+ /* incompatible nullability */
return 0;
}
@@ -320,7 +320,7 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
proto_arg_info = &proto->common.arg_info[proto->common.num_args];
}
- if (!zend_do_perform_type_hint_check(fe, fe_arg_info, proto, proto_arg_info)) {
+ if (!zend_do_perform_type_hint_check(fe, i, fe_arg_info, proto, proto_arg_info)) {
return 0;
}
@@ -338,7 +338,7 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
return 0;
}
- if (!zend_do_perform_type_hint_check(fe, fe->common.arg_info - 1, proto, proto->common.arg_info - 1)) {
+ if (!zend_do_perform_type_hint_check(fe, i, fe->common.arg_info - 1, proto, proto->common.arg_info - 1)) {
return 0;
}
}