File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed
Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -3689,9 +3689,7 @@ static zend_always_inline zend_result _zend_update_type_info(
36893689 UPDATE_SSA_TYPE (tmp , ssa_op -> op1_def );
36903690 } else {
36913691 /* invalid key type */
3692- tmp = (tmp & (MAY_BE_RC1 |MAY_BE_RCN |MAY_BE_ARRAY )) |
3693- (t1 & ~(MAY_BE_RC1 |MAY_BE_RCN |MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE ));
3694- UPDATE_SSA_TYPE (tmp , ssa_op -> op1_def );
3692+ return SUCCESS ;
36953693 }
36963694 COPY_SSA_OBJ_TYPE (ssa_op -> op1_use , ssa_op -> op1_def );
36973695 }
Original file line number Diff line number Diff line change 1+ --TEST--
2+ Type inference 023: FETCH_DIM_W
3+ --INI--
4+ opcache.enable=1
5+ opcache.enable_cli=1
6+ opcache.optimization_level=-1
7+ --FILE--
8+ <?php
9+ function foo ($ data ): array {
10+ $ a = [];
11+ $ n = -1 ;
12+ foreach ($ data as $ d ) {
13+ if ($ n >= 0 ) {
14+ $ a [$ n ]->x = 2 ;
15+ }
16+ $ n ++;
17+ $ a [$ n ] = new stdClass ();
18+ $ a [$ n ]->x = 1 ;
19+ }
20+ }
21+ ?>
22+ DONE
23+ --EXPECT--
24+ DONE
You can’t perform that action at this time.
0 commit comments