I have the following code:
$packed = pack('i',PHP_INT_MAX);
echo unpack('i', $packed)[1];
As result I get -1
I’m using PHP 5.4.6-1ubuntu1.1 (cli) (built: Nov 15 2012 01:18:34)
and my PHP_INT_MAx is equal to 9223372036854775807
Is there any way to work with pack function and 64 bit integers?
Save it as two 32Bit instead: