PHP converts an integer to a float if it is greater than PHP_INT_MAX. For 32-bit systems, this is 2147483647.
The answer to the questions is related to the string representation of floats in PHP.
If the exponent in scientific notation is greater than 13 or less than -4 , PHP will use the scientific representation when printing floats.
Examples:
echo 0.0001; // 0.0001; echo 0.00001; // 1.0E-5 // 14 digits echo 10000000000000; // 10000000000000 // 15 digits echo 100000000000000; // 1.0E+14
See float vs. double precision
source share