Home >Backend Development >PHP Tutorial >apache - php On a 64-bit machine, int (76561197960265728) will be automatically converted to float type
1. It runs normally on a personal laptop and Sina server, but this problem occurs when running on a company
. The one in the company is php5.6 and a 64-bit operating system
2. The code is as follows:
3. The normal result is:
4. The abnormal result:
5. What is the reason for this? Is it a problem with the PHP version, the operating system, or something else?
1. It runs normally on a personal laptop and Sina server, but this problem occurs when running on a company
. The one in the company is php5.6 and a 64-bit operating system
2. The code is as follows:
3. The normal result is:
4. The abnormal result:
5. What is the reason for this? Is it a problem with the PHP version, the operating system, or something else?
http://php.net/manual/zh/language.types.integer.php
<code>如果给定的一个数超出了 integer 的范围,将会被解释为 float。同样如果执行的运算结果超出了 integer 范围,也会返回 float。</code>
You can try it first PHP_INT_MAX
and see if there is any difference in size between your machine and the service
I don’t dare to solve this problem by converting the final result to string