Skip to content

Commit bb04741

Browse files
committed
Fix variance bug where too many errors were suppressed
1 parent 1652c84 commit bb04741

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Zend/zend_inheritance.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,7 +2001,7 @@ static void _inheritance_runtime_error_msg(zend_function *child, zend_function *
20012001
zend_function *proto = child->common.prototype;
20022002
if ((proto && (proto->common.fn_flags & ZEND_ACC_ABSTRACT))
20032003
|| ((parent->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE)
2004-
&& !_check_inherited_return_type(child, child->common.arg_info - 1, parent, parent->common.arg_info - 1)))
2004+
&& _check_inherited_return_type(child, child->common.arg_info - 1, parent, parent->common.arg_info - 1) <= 0))
20052005
{
20062006
zend_string *method_prototype = zend_get_function_declaration(parent);
20072007
zend_string *child_prototype = zend_get_function_declaration(child);
@@ -2041,7 +2041,7 @@ ZEND_API void zend_verify_variance(zend_class_entry *ce) /* {{{ */
20412041
int check = _check_inherited_return_type(
20422042
child, &child->common.arg_info[-1],
20432043
parent, &parent->common.arg_info[-1]);
2044-
if (check < 0) {
2044+
if (check <= 0) {
20452045
_inheritance_runtime_error_msg(child, parent);
20462046
// todo: what to do with errors, not warnings?
20472047
continue;
@@ -2082,7 +2082,7 @@ ZEND_API void zend_verify_variance(zend_class_entry *ce) /* {{{ */
20822082
child, child_arg_info,
20832083
parent, parent_arg_info);
20842084

2085-
if (check < 0) {
2085+
if (check <= 0) {
20862086
_inheritance_runtime_error_msg(child, parent);
20872087
// todo: what to do with errors, not warnings?
20882088
continue;

0 commit comments

Comments
 (0)