You happen to use a value that is bigger than the integer maximum. As read in What is the maximum value for a int32?, this value is 2,147,483,647.
From PHP.net in mt_rand():
Description
int mt_rand ( void )
int mt_rand ( int $min , int $max )
Return Values
A random integer value between min (or 0) and max (or mt_getrandmax(),
inclusive), or FALSE if max is less than min.
From the PHP manual:
The size of an integer is platform-dependent, although a maximum value
of about two billion is the usual value (that's 32 bits signed). PHP
does not support unsigned integers. Integer size can be determined
using the constant PHP_INT_SIZE, and maximum value using the constant
PHP_INT_MAX since PHP
4.4.0 and PHP 5.0.5.
Your script fails on 32 bits systems because you are providing a value which is ~4 billion, while the maximum is ~2 billion. A workaround can be to change PHP_INT_MAX
.