Why do I get the following output on an x64 architecture?
$ php -r 'echo pow(2, 33) . "\n";print_r(unpack("Ivalue", pack("I", pow(2, 33))));'
8589934592
Array
(
[value] => 0
)
It seems as though it can handle signed 64-bit ints, but it can't pack / unpack them. According to the documentation, http://us3.php.net/pack, the size of I should be machine-dependent, which in this case is 64 bit.
$ php -r 'echo PHP_INT_MAX;'
9223372036854775807
$ php -v
PHP 5.2.9 (cli) (built: Apr 17 2009 03:29:14)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies