Merge branch 'PHP-8.3'

* PHP-8.3:
  Fixed GH-12262: Tracing JIT assertion crash when using phpstan
This commit is contained in:
Dmitry Stogov 2023-10-03 13:25:46 +03:00
commit a01e0aa590
2 changed files with 44 additions and 1 deletions

View File

@ -2191,7 +2191,7 @@ static const zend_property_info *zend_fetch_prop_info(const zend_op_array *op_ar
if (opline->op2_type == IS_CONST) {
const zend_class_entry *ce = NULL;
if (opline->op1_type == IS_UNUSED) {
if (opline->op1_type == IS_UNUSED && !(op_array->fn_flags & ZEND_ACC_TRAIT_CLONE)) {
ce = op_array->scope;
} else if (ssa_op->op1_use >= 0) {
ce = ssa->var_info[ssa_op->op1_use].ce;

View File

@ -0,0 +1,43 @@
--TEST--
GH-12262: Tracing JIT assertion crash when using phpstan
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_hot_func=2
--FILE--
<?php
class C {
}
trait T {
public function equal(C $type): bool {
return $type instanceof self && $this->value === $type->value;
}
}
class C1 extends C {
use T;
public function __construct(private int $value) {
}
}
class C2 extends C {
use T;
public function __construct(private string $value) {
}
}
$x = new C1(1);
var_dump($x->equal($x));
var_dump($x->equal($x));
var_dump($x->equal($x));
$a = new C2("aaa");
var_dump($a->equal($a));
var_dump($a->equal($a));
var_dump($a->equal($a));
?>
--EXPECT--
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)