I am very confused about the behavior of the left shift function. I use it on two different machines (dev and hosting) and they give me different answers. I tracked it before this calculation:
(-3941404251) << 5;
On one machine, I get the answer -1570884448; on the other hand, I get 0. On both systems, PHP_INT_MAX = 2147483647. Later it is a 32-bit system and the first is 64-bit, although php works like a 32-bit process and still gives the same answer.
I can only assume that this is a problem with 32-bit and 64-bit, but is there an easy way to get the desired behavior. If someone can point me to a function or something else, that would be great.
Thank!
source
share