We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5049143 commit 71126aaCopy full SHA for 71126aa
src/Type/ConstantTypeHelper.php
@@ -34,9 +34,6 @@ public static function getTypeFromValue($value): Type
34
if (is_int($value)) {
35
return new ConstantIntegerType($value);
36
} elseif (is_float($value)) {
37
- if (is_nan($value)) {
38
- return new MixedType();
39
- }
40
return new ConstantFloatType($value);
41
} elseif (is_bool($value)) {
42
return new ConstantBooleanType($value);
tests/PHPStan/Analyser/nsrt/bug-13097.php
@@ -0,0 +1,14 @@
1
+<?php
2
+
3
+namespace Bug13097;
4
5
+use function PHPStan\Testing\assertType;
6
7
+$f = -1 * INF;
8
+assertType('-INF', $f);
9
10
+$f = 0 * INF;
11
+assertType('NAN', $f);
12
13
+$f = 1 * INF;
14
+assertType('INF', $f);
0 commit comments