Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
  Fixed type inference for FETCH_DIM_W without use
This commit is contained in:
Dmitry Stogov 2021-11-03 19:45:30 +03:00
commit 22a171a0b5
2 changed files with 21 additions and 0 deletions

View File

@ -3363,6 +3363,10 @@ static zend_always_inline int _zend_update_type_info(
|| opline->opcode == ZEND_FETCH_DIM_FUNC_ARG
|| opline->opcode == ZEND_FETCH_LIST_W) {
j = ssa_vars[ssa_op->result_def].use_chain;
if (j < 0) {
/* no uses */
tmp |= key_type | MAY_BE_ARRAY | MAY_BE_ARRAY_OF_NULL;
}
while (j >= 0) {
zend_uchar opcode;

View File

@ -0,0 +1,17 @@
--TEST--
JIT FETCH_DIM_W: 002
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
--FILE--
<?php
function test() {
$b = [&$a[0]];
}
test();
?>
DONE
--EXPECT--
DONE