mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.1'
* PHP-8.1: Fix GH-7757: Multi-inherited final constant causes fatal error
This commit is contained in:
commit
dd6b1b7ef7
2 changed files with 19 additions and 1 deletions
|
@ -1601,7 +1601,7 @@ static bool do_inherit_constant_check(
|
|||
}
|
||||
|
||||
zend_class_constant *old_constant = Z_PTR_P(zv);
|
||||
if ((ZEND_CLASS_CONST_FLAGS(parent_constant) & ZEND_ACC_FINAL)) {
|
||||
if (parent_constant->ce != old_constant->ce && (ZEND_CLASS_CONST_FLAGS(parent_constant) & ZEND_ACC_FINAL)) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "%s::%s cannot override final constant %s::%s",
|
||||
ZSTR_VAL(old_constant->ce->name), ZSTR_VAL(name),
|
||||
ZSTR_VAL(parent_constant->ce->name), ZSTR_VAL(name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue