]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.5' into PHP-5.6
authorXinchen Hui <laruence@php.net>
Tue, 21 Apr 2015 14:37:00 +0000 (22:37 +0800)
committerXinchen Hui <laruence@php.net>
Tue, 21 Apr 2015 14:37:00 +0000 (22:37 +0800)
1  2 
Zend/zend_compile.c

index 8f127d4193f61089f4c934ab711e51fcbe1e9779,719f6e7de2fa9d646995c0fd4febbc563330e590..82cfb33124f50e7838db439893ccb50c195f896b
@@@ -4051,17 -3912,18 +4051,18 @@@ static void zend_add_trait_method(zend_
                        }
                        zend_hash_quick_update(*overriden, arKey, nKeyLength, h, fn, sizeof(zend_function), (void**)&fn);
                        return;
-               } else if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
+               } else if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT &&
+                               (existing_fn->common.scope->ce_flags & ZEND_ACC_INTERFACE) == 0) {
                        /* Make sure the trait method is compatible with previosly declared abstract method */
                        if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) {
 -                              zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
 +                              zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
                                        zend_get_function_declaration(fn TSRMLS_CC),
                                        zend_get_function_declaration(existing_fn TSRMLS_CC));
                        }
-               } else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
+               } else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) { 
                        /* Make sure the abstract declaration is compatible with previous declaration */
                        if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) {
 -                              zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
 +                              zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
                                        zend_get_function_declaration(fn TSRMLS_CC),
                                        zend_get_function_declaration(existing_fn TSRMLS_CC));
                        }