From fc673ee9966b7fce1a7ec8f1ca40952a3772a3b1 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Tue, 18 Apr 2023 14:36:42 +0200 Subject: [PATCH] Fix INF logic --- src/Reflection/InitializerExprTypeResolver.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Reflection/InitializerExprTypeResolver.php b/src/Reflection/InitializerExprTypeResolver.php index 0759e6a5d3..04d5a4fa03 100644 --- a/src/Reflection/InitializerExprTypeResolver.php +++ b/src/Reflection/InitializerExprTypeResolver.php @@ -73,6 +73,7 @@ use function dirname; use function floor; use function in_array; +use function is_finite; use function is_float; use function is_int; use function max; @@ -1642,10 +1643,10 @@ private function integerRangeMath(Type $range, BinaryOp $node, Type $operand): T $min = min($min1, $min2, $max1, $max2); $max = max($min1, $min2, $max1, $max2); - if ($min === -INF) { + if (!is_finite($min)) { $min = null; } - if ($max === INF) { + if (!is_finite($max)) { $max = null; } } else {