Spent an hour hunting down a PHP bug relating to the number above. I should have noticed that this is the largest 32-bit signed integer (2^31 - 1).

So it's also the largest number PHP's integer type can handle, as you'll find if you run this PHP integer precision test (via Elliot Back):


$max = 0;
$i = 1;
$step = 1;
while($max + 1 === (int) ($max + 1))
{
    if($i === (int) $i)
    {
        $max = max($i, $max);
        $step += $step;
    } else 
    {
        $i = $max;
        $step = 1;
    }
    $i = $i + $step;
}

PHP's lack of native double precision number representation is bemusing. Floats can be used instead, though they carry representation repercussions if you want to persist them.

The native arbitrary precision math functions are available, but the morale of the story remains cautionary: don't use PHP for number crunching.