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 1616use function is_bool ;
1717use function is_float ;
1818use function is_int ;
19- use function is_nan ;
2019use function is_object ;
2120use function is_string ;
2221
@@ -34,9 +33,6 @@ public static function getTypeFromValue($value): Type
3433 if (is_int ($ value )) {
3534 return new ConstantIntegerType ($ value );
3635 } elseif (is_float ($ value )) {
37- if (is_nan ($ value )) {
38- return new MixedType ();
39- }
4036 return new ConstantFloatType ($ value );
4137 } elseif (is_bool ($ value )) {
4238 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