File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -3257,17 +3257,20 @@ static zend_always_inline zend_result _zend_update_type_info(
3257
3257
key_type |= MAY_BE_ARRAY_PACKED ;
3258
3258
}
3259
3259
if (t1 & MAY_BE_ARRAY ) {
3260
- key_type |= MAY_BE_HASH_ONLY (t1 ) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
3260
+ key_type |= (MAY_BE_HASH_ONLY (t1 ) || (t1 & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE ))) ?
3261
+ MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
3261
3262
}
3262
3263
} else {
3263
3264
if (t2 & (MAY_BE_LONG |MAY_BE_FALSE |MAY_BE_TRUE |MAY_BE_RESOURCE |MAY_BE_DOUBLE )) {
3264
- key_type |= MAY_BE_HASH_ONLY (t1 ) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
3265
+ key_type |= (MAY_BE_HASH_ONLY (t1 ) || (t1 & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE ))) ?
3266
+ MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
3265
3267
}
3266
3268
if (t2 & MAY_BE_STRING ) {
3267
3269
key_type |= MAY_BE_ARRAY_KEY_STRING ;
3268
3270
if (opline -> op2_type != IS_CONST ) {
3269
3271
// FIXME: numeric string
3270
- key_type |= MAY_BE_HASH_ONLY (t1 ) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
3272
+ key_type |= (MAY_BE_HASH_ONLY (t1 ) || (t1 & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE ))) ?
3273
+ MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
3271
3274
}
3272
3275
}
3273
3276
if (t2 & (MAY_BE_UNDEF | MAY_BE_NULL )) {
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Type inference 009: FRTCH_DIM_W
3
+ --INI--
4
+ opcache.enable=1
5
+ opcache.enable_cli=1
6
+ opcache.optimization_level=-1
7
+ --FILE--
8
+ <?php
9
+ function y () {
10
+ for (;;) {
11
+ $ arr [y][]=y;
12
+ $ arr =['' =>y];
13
+ }
14
+ }
15
+ ?>
16
+ DONE
17
+ --EXPECT--
18
+ DONE
You can’t perform that action at this time.
0 commit comments