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 @@ -3682,9 +3682,7 @@ static zend_always_inline zend_result _zend_update_type_info(
36823682 UPDATE_SSA_TYPE (tmp , ssa_op -> op1_def );
36833683 } else {
36843684 /* invalid key type */
3685- tmp = (tmp & (MAY_BE_RC1 |MAY_BE_RCN |MAY_BE_ARRAY )) |
3686- (t1 & ~(MAY_BE_RC1 |MAY_BE_RCN |MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE ));
3687- UPDATE_SSA_TYPE (tmp , ssa_op -> op1_def );
3685+ return SUCCESS ;
36883686 }
36893687 COPY_SSA_OBJ_TYPE (ssa_op -> op1_use , ssa_op -> op1_def );
36903688 }
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