@@ -2355,7 +2355,6 @@ static void zend_add_trait_method(zend_class_entry *ce, zend_string *name, zend_
2355
2355
{
2356
2356
zend_function * existing_fn = NULL ;
2357
2357
zend_function * new_fn ;
2358
- bool check_inheritance = false;
2359
2358
2360
2359
if ((existing_fn = zend_hash_find_ptr (& ce -> function_table , key )) != NULL ) {
2361
2360
/* if it is the same function with the same visibility and has not been assigned a class scope yet, regardless
@@ -2389,8 +2388,6 @@ static void zend_add_trait_method(zend_class_entry *ce, zend_string *name, zend_
2389
2388
ZSTR_VAL (fn -> common .scope -> name ), ZSTR_VAL (fn -> common .function_name ),
2390
2389
ZSTR_VAL (ce -> name ), ZSTR_VAL (name ),
2391
2390
ZSTR_VAL (existing_fn -> common .scope -> name ), ZSTR_VAL (existing_fn -> common .function_name ));
2392
- } else {
2393
- check_inheritance = true;
2394
2391
}
2395
2392
}
2396
2393
@@ -2410,19 +2407,6 @@ static void zend_add_trait_method(zend_class_entry *ce, zend_string *name, zend_
2410
2407
function_add_ref (new_fn );
2411
2408
fn = zend_hash_update_ptr (& ce -> function_table , key , new_fn );
2412
2409
zend_add_magic_method (ce , fn , key );
2413
-
2414
- if (check_inheritance ) {
2415
- /* Inherited members are overridden by members inserted by traits.
2416
- * Check whether the trait method fulfills the inheritance requirements. */
2417
- uint32_t flags = ZEND_INHERITANCE_CHECK_PROTO | ZEND_INHERITANCE_CHECK_VISIBILITY ;
2418
- if (!(existing_fn -> common .scope -> ce_flags & ZEND_ACC_TRAIT )) {
2419
- flags |= ZEND_INHERITANCE_SET_CHILD_CHANGED |ZEND_INHERITANCE_SET_CHILD_PROTO |
2420
- ZEND_INHERITANCE_RESET_CHILD_OVERRIDE ;
2421
- }
2422
- do_inheritance_check_on_method (
2423
- fn , fixup_trait_scope (fn , ce ), existing_fn , fixup_trait_scope (existing_fn , ce ),
2424
- ce , NULL , flags );
2425
- }
2426
2410
}
2427
2411
/* }}} */
2428
2412
0 commit comments