File tree Expand file tree Collapse file tree 2 files changed +44
-1
lines changed
Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -2191,7 +2191,7 @@ static const zend_property_info *zend_fetch_prop_info(const zend_op_array *op_ar
21912191 if (opline -> op2_type == IS_CONST ) {
21922192 const zend_class_entry * ce = NULL ;
21932193
2194- if (opline -> op1_type == IS_UNUSED ) {
2194+ if (opline -> op1_type == IS_UNUSED && !( op_array -> fn_flags & ZEND_ACC_TRAIT_CLONE ) ) {
21952195 ce = op_array -> scope ;
21962196 } else if (ssa_op -> op1_use >= 0 ) {
21972197 ce = ssa -> var_info [ssa_op -> op1_use ].ce ;
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-12262: Tracing JIT assertion crash when using phpstan
3+ --INI--
4+ opcache.enable=1
5+ opcache.enable_cli=1
6+ opcache.file_update_protection=0
7+ opcache.jit_hot_func=2
8+ --FILE--
9+ <?php
10+ class C {
11+ }
12+ trait T {
13+ public function equal (C $ type ): bool {
14+ return $ type instanceof self && $ this ->value === $ type ->value ;
15+ }
16+ }
17+ class C1 extends C {
18+ use T;
19+ public function __construct (private int $ value ) {
20+ }
21+ }
22+ class C2 extends C {
23+ use T;
24+ public function __construct (private string $ value ) {
25+ }
26+ }
27+ $ x = new C1 (1 );
28+ var_dump ($ x ->equal ($ x ));
29+ var_dump ($ x ->equal ($ x ));
30+ var_dump ($ x ->equal ($ x ));
31+
32+ $ a = new C2 ("aaa " );
33+ var_dump ($ a ->equal ($ a ));
34+ var_dump ($ a ->equal ($ a ));
35+ var_dump ($ a ->equal ($ a ));
36+ ?>
37+ --EXPECT--
38+ bool(true)
39+ bool(true)
40+ bool(true)
41+ bool(true)
42+ bool(true)
43+ bool(true)
You can’t perform that action at this time.
0 commit comments