File tree 2 files changed +19
-2
lines changed 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -3219,10 +3219,11 @@ static zend_always_inline int _zend_update_type_info(
3219
3219
tmp |= t1 & (MAY_BE_RC1 |MAY_BE_RCN );
3220
3220
}
3221
3221
}
3222
- if (opline -> opcode == ZEND_FETCH_DIM_RW
3222
+ if ((key_type & (MAY_BE_ARRAY_KEY_LONG |MAY_BE_ARRAY_KEY_STRING ))
3223
+ && (opline -> opcode == ZEND_FETCH_DIM_RW
3223
3224
|| opline -> opcode == ZEND_FETCH_DIM_W
3224
3225
|| opline -> opcode == ZEND_FETCH_DIM_FUNC_ARG
3225
- || opline -> opcode == ZEND_FETCH_LIST_W ) {
3226
+ || opline -> opcode == ZEND_FETCH_LIST_W )) {
3226
3227
j = ssa_vars [ssa_op -> result_def ].use_chain ;
3227
3228
if (j < 0 ) {
3228
3229
/* no uses */
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Type inference 006: FETCH_DIM_W with invalid key type
3
+ --INI--
4
+ opcache.enable=1
5
+ opcache.enable_cli=1
6
+ opcache.optimization_level=-1
7
+ --FILE--
8
+ <?php
9
+ function y () {
10
+ $ obj =new y ;
11
+ u ($ y [$ obj ]);
12
+ }
13
+ ?>
14
+ DONE
15
+ --EXPECT--
16
+ DONE
You can’t perform that action at this time.
0 commit comments