File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -3002,7 +3002,9 @@ static zend_always_inline int _zend_update_type_info(
3002
3002
if (ssa_op -> result_use >= 0 ) {
3003
3003
tmp |= ssa_var_info [ssa_op -> result_use ].type ;
3004
3004
}
3005
- if (opline -> op1_type != IS_UNUSED ) {
3005
+ if (opline -> op1_type != IS_UNUSED
3006
+ && (opline -> op2_type == IS_UNUSED
3007
+ || (t2 & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE |MAY_BE_TRUE |MAY_BE_LONG |MAY_BE_DOUBLE |MAY_BE_RESOURCE |MAY_BE_STRING )))) {
3006
3008
tmp |= (t1 & MAY_BE_ANY ) << MAY_BE_ARRAY_SHIFT ;
3007
3009
if (t1 & MAY_BE_UNDEF ) {
3008
3010
tmp |= MAY_BE_ARRAY_OF_NULL ;
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Type inference 002: Type inference for INIT_ARRAY with invalid index
3
+ --INI--
4
+ opcache.enable=1
5
+ opcache.enable_cli=1
6
+ opcache.optimization_level=-1
7
+ --FILE--
8
+ <?php
9
+ var_dump ([[]=>&$ x ]);
10
+ ?>
11
+ --EXPECTF--
12
+ Fatal error: Uncaught TypeError: Illegal offset type in %sinference_002.php:2
13
+ Stack trace:
14
+ #0 {main}
15
+ thrown in %sinference_002.php on line 2
You can’t perform that action at this time.
0 commit comments