PHP 4.0 Bug #8293 Updated: rand function failure
| From: | hholzgra@php.net | Date: | Mon, 18 Dec 2000 11:00:54 +0000 |
| Subject: | PHP 4.0 Bug #8293 Updated: rand function failure | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-41722@lists.php.net to get a copy of this message | ||
ID: 8293
Updated by: hholzgra
Reported By: edasx@worldoffreegames.com
Old-Status: Open
Status: Closed
Bug Type: Unknown/Other Function
Assigned To:
Comments:
the maximum range for rand() is platform-dependant,
use getrandmax() to see what it is for your system
or use mt_rand() if you want to have platform independant
randomness
Previous Comments:
---------------------------------------------------------------------------
[2000-12-16 10:20:34] edasx@worldoffreegames.com
srand((double)microtime()*1000000);
$rndnum = rand(1, 100000);
this fails, with invalid range error.
the range of
$rndnum = rand(1, 32530);
does not fail and around 34000 fails, so there's probably incorrect type (integer) that's
too small.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8293