1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 00:18:23 +02:00

Fix range() return type inference for undef operand

This results in a long range.
This commit is contained in:
Nikita Popov
2021-09-21 17:01:05 +02:00
parent 37337507ec
commit a846547ed4
2 changed files with 5 additions and 1 deletions
+2 -1
View File
@@ -75,7 +75,8 @@ static uint32_t zend_range_info(const zend_call_info *call_info, const zend_ssa
|| (t3 & (MAY_BE_DOUBLE|MAY_BE_STRING))) {
tmp |= MAY_BE_ARRAY_OF_DOUBLE;
}
if ((t1 & (MAY_BE_ANY-(MAY_BE_STRING|MAY_BE_DOUBLE))) && (t2 & (MAY_BE_ANY-(MAY_BE_STRING|MAY_BE_DOUBLE)))) {
if ((t1 & ((MAY_BE_ANY|MAY_BE_UNDEF)-(MAY_BE_STRING|MAY_BE_DOUBLE)))
&& (t2 & ((MAY_BE_ANY|MAY_BE_UNDEF)-(MAY_BE_STRING|MAY_BE_DOUBLE)))) {
if ((t3 & MAY_BE_ANY) != MAY_BE_DOUBLE) {
tmp |= MAY_BE_ARRAY_OF_LONG;
}
@@ -16,6 +16,9 @@ function test(\SplObjectStorage $definitions = null) {
function test2() {
$a[[]] = $undef;
}
function test3() {
foreach (range(0, $undef) as $v) { }
}
?>
===DONE===