The integer you want to express:
$var = 10000000000000000000000000;
not available on your system. It is too large and therefore PHP will convert it to a float, which will change the number (an example of a 32-bit system):
10000000000000000905969664
General restrictions:
yours : 10 000 000 000 000 000 000 000 000 32 bit: 2 147 483 648 64 bit: 9 223 372 036 854 775 808
Changing the value is called floating point precision, the PHP manual on integers tells you about the integer limit and the floating point page on floating point precision (see big red warning). Depending on your system, you can compile PHP with the ranges required by your application, or you should use a different data type, for example, gmp library , which is able to select strings as integers and process them.
The following example shows only the output, but you can do multiplications, etc.:
$r = gmp_init('10000000000000000000000000'); echo gmp_strval($r);
Hope this will be helpful.
hakre source share