I'm having problems running a php program on my Linux box which runs fine on my Windows box.
I traced the problem down to a line of code:
$higherValue = 0xFFFFFFFF;
This should be an maximum unsigned int value of 4294967295, but PHP doesn't handle unsigned int so it should convert it to a float. This is not happening on my system. Instead it is just converting it to a max int value of 2147483647.
I wrote a small php test script:
var_dump(0x00000000);
var_dump(0xFFFFFFFF);
var_dump(0xFFFFFFFE);
On Windows:
int(0)
float(4294967295)
float(4294967294)
On Linux:
int(0)
int(2147483647)
int(2147483647)
Versions:
Windows:
>.\win32\php -c php-win.ini -v
PHP 5.3.15 (cli) (built: Jul 20 2012 00:20:38)
Copyright © 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright © 1998-2012 Zend Technologies
Linux:
> php -v
PHP 5.3.27 (cli) (built: Jun 24 2014 01:48:44)
Copyright © 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright © 1998-2013 Zend Technologies
How do I get integer overflow working? Do I have a bad build of PHP?