diff options
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r-- | Zend/zend_compile.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 841e1b9316..21e5ca2f6b 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3786,7 +3786,6 @@ static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int } fn->common.scope = ce; - fn->common.prototype = prototype; if (prototype && (prototype->common.fn_flags & ZEND_ACC_IMPLEMENTED_ABSTRACT @@ -3801,11 +3800,14 @@ static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int if (prototype) { do_inheritance_check_on_method(fn, prototype TSRMLS_CC); } + /* one more thing: make sure we properly implement an abstract method */ if (existing_fn && existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) { do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC); } + fn->common.prototype = prototype; + /* delete inherited fn if the function to be added is not abstract */ if (existing_fn && existing_fn->common.scope != ce |