From: Dmitry Stogov Date: Thu, 14 Feb 2019 10:18:45 +0000 (+0300) Subject: Merge branch 'PHP-7.4' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4474cf43e6ba4faa33e66146bfa2859e1094b32f;p=php Merge branch 'PHP-7.4' * PHP-7.4: Fixed bug #77613 (method visibility change) (reverted ZEND_ACC_CTOR and ZEND_ACC_DTOR flags removal) --- 4474cf43e6ba4faa33e66146bfa2859e1094b32f diff --cc Zend/zend_API.c index 0b745161ff,f191ca25b9..c03b6bfa5b --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@@ -2317,8 -2344,10 +2318,9 @@@ ZEND_API int zend_register_functions(ze if (ctor->common.fn_flags & ZEND_ACC_STATIC) { zend_error(error_type, "Constructor %s::%s() cannot be static", ZSTR_VAL(scope->name), ZSTR_VAL(ctor->common.function_name)); } - ctor->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC; } if (dtor) { + dtor->common.fn_flags |= ZEND_ACC_DTOR; if (dtor->common.fn_flags & ZEND_ACC_STATIC) { zend_error(error_type, "Destructor %s::%s() cannot be static", ZSTR_VAL(scope->name), ZSTR_VAL(dtor->common.function_name)); } diff --cc Zend/zend_compile.c index 1ebc7c1bf3,03f8cf2563..33e6e47e9c --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@@ -6217,7 -6264,13 +6217,8 @@@ void zend_compile_class_decl(zend_ast * /* Reset lineno for final opcodes and errors */ CG(zend_lineno) = ast->lineno; - if (!(ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS)) { - /* For traits this check is delayed until after trait binding */ - zend_check_deprecated_constructor(ce); - } - if (ce->constructor) { + ce->constructor->common.fn_flags |= ZEND_ACC_CTOR; if (ce->constructor->common.fn_flags & ZEND_ACC_STATIC) { zend_error_noreturn(E_COMPILE_ERROR, "Constructor %s::%s() cannot be static", ZSTR_VAL(ce->name), ZSTR_VAL(ce->constructor->common.function_name));