@@ -2001,7 +2001,7 @@ static void _inheritance_runtime_error_msg(zend_function *child, zend_function *
2001
2001
zend_function * proto = child -> common .prototype ;
2002
2002
if ((proto && (proto -> common .fn_flags & ZEND_ACC_ABSTRACT ))
2003
2003
|| ((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 ))
2005
2005
{
2006
2006
zend_string * method_prototype = zend_get_function_declaration (parent );
2007
2007
zend_string * child_prototype = zend_get_function_declaration (child );
@@ -2041,7 +2041,7 @@ ZEND_API void zend_verify_variance(zend_class_entry *ce) /* {{{ */
2041
2041
int check = _check_inherited_return_type (
2042
2042
child , & child -> common .arg_info [-1 ],
2043
2043
parent , & parent -> common .arg_info [-1 ]);
2044
- if (check < 0 ) {
2044
+ if (check <= 0 ) {
2045
2045
_inheritance_runtime_error_msg (child , parent );
2046
2046
// todo: what to do with errors, not warnings?
2047
2047
continue ;
@@ -2082,7 +2082,7 @@ ZEND_API void zend_verify_variance(zend_class_entry *ce) /* {{{ */
2082
2082
child , child_arg_info ,
2083
2083
parent , parent_arg_info );
2084
2084
2085
- if (check < 0 ) {
2085
+ if (check <= 0 ) {
2086
2086
_inheritance_runtime_error_msg (child , parent );
2087
2087
// todo: what to do with errors, not warnings?
2088
2088
continue ;
0 commit comments