jpfuentes2/php-activerecord — pull request #403 by Rican7 (2014-02-27 07:45:31+00:00)
Title: Bugfix - Bigint cast

This PR fixes #185, a **lonnng** outstanding issue.

Essentially the problem is that SQL "bigint" columns can store unsigned integers up to 64-bit precision, which is technically larger than PHP_INT_MAX even on a 64-bit machine due to the 2's complement signing style that PHP uses for integers internally. The problem is even more obvious when using a 32-bit machine...

This PR fixes the problem by checking if the value would cause an overflow and instead will keep the value as a numeric string (great for SQL storage). Yes, this really only fixes an edge case, which is why it may not have been fixed earlier.