According to this new post on the MySQL Performance Blog, PHP has a bit of an issue when it comes to working with integers.
Until recently I thought that currently popular scripting languages, which mostly evolved over last 10 years or something, must allow for easier portability across different platforms compared to ye good olde C/C++.
However, PHP just brought me a new definition of "portable" - and that was when working with... integers.
He points out that PHP isn't able to correctly handle unsigned integers ("and converts values over 2^31 to signed"). He goes on to talk about how this differs between platforms too (32 vs 64 bit) and some of the research he did to find out just what was going on (including some code examples to illustrate the point).