Edit report at http://bugs.php.net/bug.php?id=53403&edit=1
ID: 53403
User updated by: php-bugs at thequod dot de
Reported by: php-bugs at thequod dot de
-Summary: mr_rand() without min/max uses invalid min/max
values
+Summary: mt_rand() without min/max uses invalid min/max
values
Status: Open
Type: Bug
Package: Unknown/Other Function
Operating System: Linux
PHP Version: 5.3SVN-2010-11-25 (snap)
Block user comment: N
Private report: N
New Comment:
Fixed title.
Previous Comments:
------------------------------------------------------------------------
[2010-11-25 14:13:04] php-bugs at thequod dot de
The following works btw:
var_dump(mt_Rand(0, mt_getrandmax()));
------------------------------------------------------------------------
[2010-11-25 14:11:24] php-bugs at thequod dot de
Description:
------------
I am getting the following warning when calling mt_rand() on
5.3.4RC2-dev (snapshot 201011231530), and it returns false:
PHP Warning: mt_rand(): max(-1080344744) is smaller than
min(137322600)
This is on a 32bit Linux container running on a 64bit host (OpenVZ).
Test script:
---------------
var_dump(mt_rand(), mt_getrandmax());
Actual result:
--------------
bool(false)
int(2147483647)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53403&edit=1