File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -2534,8 +2534,8 @@ static zend_always_inline int _zend_update_type_info(
2534
2534
}
2535
2535
if (t1 & MAY_BE_OBJECT ) {
2536
2536
tmp |= MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF ;
2537
- } else {
2538
- tmp |= ((t1 & (MAY_BE_ANY - MAY_BE_NULL )) << MAY_BE_ARRAY_SHIFT ) | ((t1 & ( MAY_BE_ANY - MAY_BE_NULL )) ? MAY_BE_ARRAY_PACKED : 0 );
2537
+ } else if ( t1 & ( MAY_BE_ANY - MAY_BE_NULL )) {
2538
+ tmp |= ((t1 & (MAY_BE_ANY - MAY_BE_NULL )) << MAY_BE_ARRAY_SHIFT ) | ((t1 & MAY_BE_NULL ) ? MAY_BE_ARRAY_KEY_LONG : MAY_BE_ARRAY_PACKED );
2539
2539
}
2540
2540
}
2541
2541
UPDATE_SSA_TYPE (tmp , ssa_op -> result_def );
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ JIT CAST: 002
3
+ --INI--
4
+ opcache.enable=1
5
+ opcache.enable_cli=1
6
+ opcache.file_update_protection=0
7
+ opcache.jit_buffer_size=1M
8
+ --FILE--
9
+ <?php
10
+ function test (?int $ i ) {
11
+ $ a = (array ) $ i ;
12
+ $ a [-1 ] = 1 ;
13
+ var_dump ($ a );
14
+ }
15
+ test (null );
16
+ ?>
17
+ --EXPECT--
18
+ array(1) {
19
+ [-1]=>
20
+ int(1)
21
+ }
You can’t perform that action at this time.
0 commit comments