File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
tests/PHPStan/Analyser/nsrt Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 16
16
use function is_bool ;
17
17
use function is_float ;
18
18
use function is_int ;
19
- use function is_nan ;
20
19
use function is_object ;
21
20
use function is_string ;
22
21
@@ -34,9 +33,6 @@ public static function getTypeFromValue($value): Type
34
33
if (is_int ($ value )) {
35
34
return new ConstantIntegerType ($ value );
36
35
} elseif (is_float ($ value )) {
37
- if (is_nan ($ value )) {
38
- return new MixedType ();
39
- }
40
36
return new ConstantFloatType ($ value );
41
37
} elseif (is_bool ($ value )) {
42
38
return new ConstantBooleanType ($ value );
Original file line number Diff line number Diff line change
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 );
You can’t perform that action at this time.
0 commit comments