Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/Type/ConstantTypeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use function is_bool;
use function is_float;
use function is_int;
use function is_nan;
use function is_object;
use function is_string;

Expand All @@ -34,9 +33,6 @@ public static function getTypeFromValue($value): Type
if (is_int($value)) {
return new ConstantIntegerType($value);
} elseif (is_float($value)) {
if (is_nan($value)) {
return new MixedType();
}
return new ConstantFloatType($value);
} elseif (is_bool($value)) {
return new ConstantBooleanType($value);
Expand Down
14 changes: 14 additions & 0 deletions tests/PHPStan/Analyser/nsrt/bug-13097.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Bug13097;

use function PHPStan\Testing\assertType;

$f = -1 * INF;
assertType('-INF', $f);

$f = 0 * INF;
assertType('NAN', $f);

$f = 1 * INF;
assertType('INF', $f);
Loading