Skip to content

Commit

Permalink
Fix INF logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Apr 18, 2023
1 parent 8ff8fb0 commit fc673ee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Reflection/InitializerExprTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit fc673ee

Please sign in to comment.