File tree 2 files changed +32
-1
lines changed
2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -3298,7 +3298,12 @@ static zend_always_inline int _zend_update_type_info(
3298
3298
ZEND_ASSERT (j < 0 && "There should only be one use" );
3299
3299
}
3300
3300
}
3301
- if (((tmp & MAY_BE_ARRAY ) && (tmp & MAY_BE_ARRAY_KEY_ANY )) || opline -> opcode == ZEND_FETCH_DIM_FUNC_ARG ) {
3301
+ if (((tmp & MAY_BE_ARRAY ) && (tmp & MAY_BE_ARRAY_KEY_ANY ))
3302
+ || opline -> opcode == ZEND_FETCH_DIM_FUNC_ARG
3303
+ || opline -> opcode == ZEND_FETCH_DIM_R
3304
+ || opline -> opcode == ZEND_FETCH_DIM_IS
3305
+ || opline -> opcode == ZEND_FETCH_DIM_UNSET
3306
+ || opline -> opcode == ZEND_FETCH_LIST_R ) {
3302
3307
UPDATE_SSA_TYPE (tmp , ssa_op -> op1_def );
3303
3308
} else {
3304
3309
/* invalid key type */
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Type inference 012: FETCH_DIM_UNSET
3
+ --INI--
4
+ opcache.enable=1
5
+ opcache.enable_cli=1
6
+ opcache.optimization_level=-1
7
+ --FILE--
8
+ <?php
9
+ function test () {
10
+ $ closure = function () {return "string " ;};
11
+ unset($ x ['b ' ][$ closure ()]['d ' ]);
12
+ $ x = $ arr ;
13
+ $ arr = ['a ' => $ closure (), 'b ' => [$ closure () => []]];
14
+ $ x = $ arr ;
15
+ unset($ x ['b ' ][$ closure ()]['d ' ]);
16
+ $ x = $ arr ;
17
+ }
18
+
19
+ test ();
20
+ ?>
21
+ DONE
22
+ --EXPECTF--
23
+ Warning: Undefined variable $x in %sinference_012.php on line 4
24
+
25
+ Warning: Undefined variable $arr in %sinference_012.php on line 5
26
+ DONE
You can’t perform that action at this time.
0 commit comments