Skip to content

Commit a45bab0

Browse files
committed
Simplify the reset of ZEND_ACC_OVERRIDE in zend_add_trait_method()
This is safe, because `inherited` is only set if the function actually exists in a parent class, thus the inheritance check would not just succeed, because there is no matching method in a parent class.
1 parent f926a92 commit a45bab0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Zend/zend_inheritance.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,9 +2009,7 @@ static void zend_add_trait_method(zend_class_entry *ce, zend_string *name, zend_
20092009
zend_add_magic_method(ce, fn, key);
20102010

20112011
if (inherited && new_fn->common.fn_flags & ZEND_ACC_OVERRIDE) {
2012-
do_inheritance_check_on_method(
2013-
new_fn, new_fn->common.scope, existing_fn, existing_fn->common.scope,
2014-
new_fn->common.scope, NULL, /* check_visibility */ 1);
2012+
new_fn->common.fn_flags &= ~ZEND_ACC_OVERRIDE;
20152013
}
20162014
}
20172015
/* }}} */

0 commit comments

Comments
 (0)