@@ -842,15 +842,15 @@ static zend_always_inline inheritance_status do_inheritance_check_on_method_ex(z
842
842
parent = proto ;
843
843
}
844
844
845
- if (!check_only && child -> common .prototype != proto ) {
845
+ if (!check_only && child -> common .prototype != proto && child_zv ) {
846
846
do {
847
847
if (child -> common .scope != ce
848
848
&& child -> type == ZEND_USER_FUNCTION
849
849
&& !child -> op_array .static_variables ) {
850
850
if (ce -> ce_flags & ZEND_ACC_INTERFACE ) {
851
851
/* Few parent interfaces contain the same method */
852
852
break ;
853
- } else if ( child_zv ) {
853
+ } else {
854
854
/* op_array wasn't duplicated yet */
855
855
zend_function * new_function = zend_arena_alloc (& CG (arena ), sizeof (zend_op_array ));
856
856
memcpy (new_function , child , sizeof (zend_op_array ));
@@ -1565,7 +1565,6 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
1565
1565
/* Abstract method signatures from the trait must be satisfied. */
1566
1566
if (fn -> common .fn_flags & ZEND_ACC_ABSTRACT ) {
1567
1567
do_inheritance_check_on_method (existing_fn , fn , ce , NULL );
1568
- fn -> common .prototype = NULL ;
1569
1568
return ;
1570
1569
}
1571
1570
@@ -1588,7 +1587,6 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
1588
1587
/* inherited members are overridden by members inserted by traits */
1589
1588
/* check whether the trait method fulfills the inheritance requirements */
1590
1589
do_inheritance_check_on_method (fn , existing_fn , ce , NULL );
1591
- fn -> common .prototype = NULL ;
1592
1590
}
1593
1591
}
1594
1592
0 commit comments