mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Improve static inference in final class (#13298)
static may be treated like self if the class is final.
This commit is contained in:
parent
2bf9f7eb19
commit
95f7335251
1 changed files with 3 additions and 1 deletions
|
@ -821,7 +821,9 @@ zend_class_entry *zend_optimizer_get_class_entry_from_op1(
|
|||
}
|
||||
} else if (opline->op1_type == IS_UNUSED && op_array->scope
|
||||
&& !(op_array->scope->ce_flags & ZEND_ACC_TRAIT)
|
||||
&& (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF) {
|
||||
&& ((opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF
|
||||
|| ((opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_STATIC
|
||||
&& (op_array->scope->ce_flags & ZEND_ACC_FINAL)))) {
|
||||
return op_array->scope;
|
||||
}
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue