Closed
Description
Symfony version(s) affected
6.3
Description
If a number is outside of 2.2250738585072014E-308
to 1.7976931348623158E+308
range, PHP converts it to -INF
or INF
.
Values INF
, -INF
and NAN
are considered float
in PHP as for the is_float
function.
The Type
constraint relies in this function to check for a valid float.
Now, are this valid float numbers? IMHO no.
FTR: this doesn't happen with integers, as PHP converts them to float once they go outside the PHP_INT_MIN
and PHP_INT_MAX
range...
How to reproduce
var_dump(is_float(INF));
var_dump(is_float(NAN));
Possible Solution
Add an extra check for is_finite
, when dealing with floats?
Additional Context
No response