mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fixed type inference
This commit is contained in:
@@ -3680,7 +3680,8 @@ static zend_always_inline zend_result _zend_update_type_info(
|
||||
tmp &= ~MAY_BE_ARRAY_EMPTY;
|
||||
}
|
||||
}
|
||||
if (((tmp & MAY_BE_ARRAY) && (tmp & MAY_BE_ARRAY_KEY_ANY))
|
||||
if (!(tmp & MAY_BE_ARRAY)
|
||||
|| (tmp & MAY_BE_ARRAY_KEY_ANY)
|
||||
|| opline->opcode == ZEND_FETCH_DIM_FUNC_ARG
|
||||
|| opline->opcode == ZEND_FETCH_DIM_R
|
||||
|| opline->opcode == ZEND_FETCH_DIM_IS
|
||||
|
||||
23
ext/opcache/tests/opt/inference_024.phpt
Normal file
23
ext/opcache/tests/opt/inference_024.phpt
Normal file
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Type inference 024: FETCH_DIM_W
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.optimization_level=-1
|
||||
--FILE--
|
||||
<?php
|
||||
function foo() {
|
||||
for ($cnt = 0; $cnt < 6; $cnt++) {
|
||||
$b = new SplFixedArray(1);
|
||||
$b[0] = $a;
|
||||
$g = &$b[0];
|
||||
$b = new SplFixedArray(1);
|
||||
$b[0] = $b;
|
||||
$g = &$b[0];
|
||||
}
|
||||
}
|
||||
@foo();
|
||||
?>
|
||||
DONE
|
||||
--EXPECT--
|
||||
DONE
|
||||
Reference in New Issue
Block a user