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:
@@ -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) {
|
||||
|
||||
18
ext/opcache/tests/opt/inference_010.phpt
Normal file
18
ext/opcache/tests/opt/inference_010.phpt
Normal 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
|
||||
Reference in New Issue
Block a user