@@ -812,15 +812,15 @@ static zend_always_inline inheritance_status do_inheritance_check_on_method_ex(z
812
812
parent = proto ;
813
813
}
814
814
815
- if (!check_only && child_zv && child -> common .prototype != proto ) {
815
+ if (!check_only && child -> common .prototype != proto ) {
816
816
do {
817
817
if (child -> common .scope != ce
818
818
&& child -> type == ZEND_USER_FUNCTION
819
819
&& !child -> op_array .static_variables ) {
820
820
if (ce -> ce_flags & ZEND_ACC_INTERFACE ) {
821
821
/* Few parent interfaces contain the same method */
822
822
break ;
823
- } else {
823
+ } else if ( child_zv ) {
824
824
/* op_array wasn't duplicated yet */
825
825
zend_function * new_function = zend_arena_alloc (& CG (arena ), sizeof (zend_op_array ));
826
826
memcpy (new_function , child , sizeof (zend_op_array ));
@@ -1585,17 +1585,14 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
1585
1585
}
1586
1586
zend_hash_update_mem (* overridden , key , fn , sizeof (zend_function ));
1587
1587
return ;
1588
- } else if (existing_fn -> common .fn_flags & ZEND_ACC_ABSTRACT &&
1589
- (existing_fn -> common .scope -> ce_flags & ZEND_ACC_INTERFACE ) == 0 ) {
1590
- /* Make sure the trait method is compatible with previosly declared abstract method */
1591
- perform_delayable_implementation_check (
1592
- ce , fn , existing_fn , /*always_error*/ 1 );
1593
- } else if (fn -> common .fn_flags & ZEND_ACC_ABSTRACT ) {
1588
+ } else if ((fn -> common .fn_flags & ZEND_ACC_ABSTRACT )
1589
+ && !(existing_fn -> common .fn_flags & ZEND_ACC_ABSTRACT )) {
1594
1590
/* Make sure the abstract declaration is compatible with previous declaration */
1595
1591
perform_delayable_implementation_check (
1596
1592
ce , existing_fn , fn , /*always_error*/ 1 );
1597
1593
return ;
1598
- } else if (UNEXPECTED (existing_fn -> common .scope -> ce_flags & ZEND_ACC_TRAIT )) {
1594
+ } else if (UNEXPECTED ((existing_fn -> common .scope -> ce_flags & ZEND_ACC_TRAIT )
1595
+ && !(existing_fn -> common .fn_flags & ZEND_ACC_ABSTRACT ))) {
1599
1596
/* two traits can't define the same non-abstract method */
1600
1597
#if 1
1601
1598
zend_error_noreturn (E_COMPILE_ERROR , "Trait method %s has not been applied, because there are collisions with other trait methods on %s" ,
0 commit comments