Merge branch 'PHP-8.1'

* PHP-8.1:
  Fixed type inference
This commit is contained in:
Dmitry Stogov 2021-09-22 15:32:24 +03:00
commit dd73e5a0b6
2 changed files with 23 additions and 0 deletions

View file

@ -2813,6 +2813,9 @@ static zend_always_inline zend_result _zend_update_type_info(
if (t1 & ((MAY_BE_ANY|MAY_BE_UNDEF) - MAY_BE_STRING)) {
tmp |= (OP1_DATA_INFO() & (MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF));
if (OP1_DATA_INFO() & MAY_BE_UNDEF) {
tmp |= MAY_BE_NULL;
}
if (opline->op2_type == IS_UNUSED) {
/* When appending to an array and the LONG_MAX key is already used
* null will be returned. */

View file

@ -0,0 +1,20 @@
--TEST--
JIT ASSIGN_DIM: 003
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
opcache.jit=tracing
--EXTENSIONS--
opcache
--FILE--
<?php
function test() {
var_dump($a[0] = $v);
}
test();
?>
--EXPECTF--
Warning: Undefined variable $v in %sassign_dim_003.php on line 3
NULL