Last weekend I changed webhosts for my website. The host server I was on was a 32-bit OS and the one I moved to is 64-bit. Unexpectedly, some of my PHP scripts started giving incorrect results.
In my case the << and >> (bit shift) operations were the culprit. I ended up having to mask the result with 0xFFFFFFFF and then changing the result if negative for it to work as it did before.
Are there any other possible problems in my PHP scripts I should look for?
It's a high level language, so anything non-bit related (bitwise operators, bitshift) will be the same.
An integer may be 64bit instead of 32bit. There are some bizarre cases where this may cause problems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With