summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index f9257698fd..b8153857e7 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1841,6 +1841,12 @@ static void do_inherit_parent_constructor(zend_class_entry *ce)
ce->destructor = ce->parent->destructor;
}
if (ce->constructor) {
+ if (ce->parent->constructor && ce->parent->constructor->common.fn_flags & ZEND_ACC_FINAL) {
+ zend_error(E_ERROR, "Cannot override final %s::%s() with %s::%s()",
+ ce->parent->name, ce->parent->constructor->common.function_name,
+ ce->name, ce->constructor->common.function_name
+ );
+ }
return;
}