does someone know how to have 64 bit integer on PHP? it seems like it is not by config file but rather it might be a compile time option and it depends on the platform?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Do the Java Integer and Double objects have unnece
- Can php detect if javascript is on or not?
Maybe you could use either GMP or BCMath extension.
UPDATE: It does now (tested on Amd Quad Core, Windows 8.1).
Note that PHP on Windows does not support 64-bit integers at all, even if both the hardware and PHP are 64-bit. See this link for details:
PHP int size is platform-dependent. There is a function called unpack() which essentially allows to convert different types of data from binary strings to PHP variables. It seems to be the only way to store as 64 bit is to store it as a string.
I found the following code at: http://www.mysqlperformanceblog.com/2007/03/27/integers-in-php-running-with-scissors-and-portability/
Native 64-bit integers require 64-bit hardware AND the 64-bit version of PHP.
On 32-bit hardware:
On 64-bit hardware:
Now you should get PHP 7 - fully consistent 64-bit support. Not only integers, but also all the fstat, IO, etc. PHP 7 on Windows is true 64-bit.