www.Bkjia.com Tutorial The integer in PHP is the long type in the C language, is signed, and the maximum value is 2^31. On a 64-bit platform, long can reach 2^63.
In this case, some of the results of the PHP function output will be inconsistent on each platform.
Php-r "Echo ip2long (' 255.255.255.255 ');" under 64-bit platforms is: 4294967295, 32-bit platform is-1. There are, for example, filesize when the file is larger than 2G, the results are inconsistent on different platforms.
The solution to this problem is simple, sprintf ("%u", FileSize ($file)). Converts the result to a string. Why would the result be the same: the complement of the unsigned number 4294967295 and the signed number-1 are the same. Similarly, a function that returns an int with the last result that may be greater than 2^31 is handled in such a way.
Note that although the return is a string, PHP will automatically reload when arithmetic is performed. If the number greater than 2^31 is converted to int if it is greater than, it is converted to double.
http://www.bkjia.com/PHPjc/364353.html www.bkjia.com true http://www.bkjia.com/PHPjc/364353.html techarticle Fire Net (liehuo.net) tutorial The integer in PHP is the long type in the C language, is signed, and the maximum value is 2^31. On a 64-bit platform, long can reach 2^63. In this case, some ...