我已经安装了 WampServer 2.0,它有 apache 2.4.4、mysql 5.6.12 和 php 5.4.12。当我回显 PHP_INT_MAX 时,它给了我 2147483647。我也回显了 phpinfo() 并且体系结构指示 x64。这应该不会发生,因为我的 php 是 64 位的,对吗?我需要我的 php 支持 64 位整数。我需要我的 PHP_INT_MAX 为 9223372036854775807。
有人可以帮助我吗?谢谢
最佳答案
如果您运行的是 Windows 操作系统,wampServer 会建议您,this is your answer :
On windows x86_64, PHP_INT_MAX is 2147483647. This is because in the underlying c-code, a long is 32 bit.
请注意,这并不意味着 Windows 不支持 64 位 int:int64_t
确实存在,但 PHP AFAIK 并未使用它。
我设法想出了 this link ,在那个页面上,有一些代码你可以使用,来为你的代码添加对 64 位整数的支持
关于php 64 位 php_int_max = 2147483647,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17837157/