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 @@ -3231,17 +3231,20 @@ static zend_always_inline int _zend_update_type_info(
3231
3231
key_type |= MAY_BE_ARRAY_PACKED ;
3232
3232
}
3233
3233
if (t1 & MAY_BE_ARRAY ) {
3234
- key_type |= MAY_BE_HASH_ONLY (t1 ) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
3234
+ key_type |= (MAY_BE_HASH_ONLY (t1 ) || (t1 & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE ))) ?
3235
+ MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
3235
3236
}
3236
3237
} else {
3237
3238
if (t2 & (MAY_BE_LONG |MAY_BE_FALSE |MAY_BE_TRUE |MAY_BE_RESOURCE |MAY_BE_DOUBLE )) {
3238
- key_type |= MAY_BE_HASH_ONLY (t1 ) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
3239
+ key_type |= (MAY_BE_HASH_ONLY (t1 ) || (t1 & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE ))) ?
3240
+ MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
3239
3241
}
3240
3242
if (t2 & MAY_BE_STRING ) {
3241
3243
key_type |= MAY_BE_ARRAY_KEY_STRING ;
3242
3244
if (opline -> op2_type != IS_CONST ) {
3243
3245
// FIXME: numeric string
3244
- key_type |= MAY_BE_HASH_ONLY (t1 ) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
3246
+ key_type |= (MAY_BE_HASH_ONLY (t1 ) || (t1 & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE ))) ?
3247
+ MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
3245
3248
}
3246
3249
}
3247
3250
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