Edit report at http://bugs.php.net/bug.php?id=53403&edit=1

 ID:                 53403
 Updated by:         cataphr...@php.net
 Reported by:        php-bugs at thequod dot de
 Summary:            mt_rand() without min/max uses invalid min/max
                     values
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            Unknown/Other Function
 Operating System:   Linux
 PHP Version:        5.3SVN-2010-11-25 (snap)
 Assigned To:        cataphract
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2010-11-25 17:44:22] cataphr...@php.net

Automatic comment from SVN on behalf of cataphract
Revision: http://svn.php.net/viewvc/?view=revision&revision=305754
Log: - Fixed bug #53403 (use of unitialized values). Fixes the fix for
bug #46587.
- Added test for bug #46587.

------------------------------------------------------------------------
[2010-11-25 14:15:35] php-bugs at thequod dot de

Fixed title.

------------------------------------------------------------------------
[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

Reply via email to