Hello,
I'm very confused about behaviour of PHP's left shift function. I'm using it on two different machines (dev and hosting), and they are giving me different answers. I've tracked it down to this calculation:
(-3941404251) << 5;
On one machine I'm getting the answer -1570884448; on the other, I get 0. On both systems, PHP_INT_MAX = 2147483647. The later is a 32-bit system, and the first a 64-bit, although php is running as a 32 bit process and still gives the same answer.
I can only assume that this is a problem with 32-bit vs 64-bit, but is there any easy way to get the desired behaviour. If somebody could point me to a function or something, that would be great.
Thanks!