With
var_dump(PHP_INT_MIN);
//int(-9223372036854775808)
I get the number -9223372036854775808. If I assign this number to a variable, it is of the float type.
$n = -9223372036854775808;
var_dump($n);
//float(-9.2233720368548E+18)
This gives me integers:
$n = PHP_INT_MIN;
var_dump($n);
//int(-9223372036854775808)
and
$n = intval("-9223372036854775808");
var_dump($n);
//int(-9223372036854775808)
and
$n = sscanf("-9223372036854775808","%d")[0];
var_dump($n);
//int(-9223372036854775808)
Why does PHP give me a float type for -9223372036854775808 ?