1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.3'

* PHP-8.3:
  Fixed type inference
This commit is contained in:
Dmitry Stogov
2023-12-01 17:09:53 +03:00
2 changed files with 25 additions and 1 deletions

View File

@@ -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

View 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