1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 22:11:12 +02:00

Merge branch 'PHP-8.1'

* PHP-8.1:
  Fix type inference
This commit is contained in:
Dmitry Stogov
2022-06-14 10:21:24 +03:00
2 changed files with 19 additions and 1 deletions

View File

@@ -3253,7 +3253,7 @@ static zend_always_inline zend_result _zend_update_type_info(
tmp |= t1 & (MAY_BE_RC1|MAY_BE_RCN);
}
if (opline->op2_type == IS_UNUSED) {
if (t1 & (MAY_BE_UNDEF|MAY_BE_NULL)) {
if (t1 & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) {
key_type |= MAY_BE_ARRAY_PACKED;
}
if (t1 & MAY_BE_ARRAY) {

View File

@@ -0,0 +1,18 @@
--TEST--
Type inference 010: FRTCH_DIM_W
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=-1
--FILE--
<?php
function foo() {
$x = false;
$x[] = &$y;
}
foo();
?>
DONE
--EXPECTF--
Deprecated: Automatic conversion of false to array is deprecated in %sinference_010.php on line 4
DONE