|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74530 Wrong note for rand()
Submitted: 2017-05-02 11:28 UTC Modified: 2017-05-02 11:37 UTC
From: olafvdspek at gmail dot com Assigned:
Status: Duplicate Package: Documentation problem
PHP Version: Irrelevant OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: olafvdspek at gmail dot com
New email:
PHP Version: OS:


 [2017-05-02 11:28 UTC] olafvdspek at gmail dot com
> Note: As of PHP 7.1.0, rand() uses the same random number generator as mt_rand(). To preserve backwards compatibility rand() allows min to be smaller than max as opposed to returning FALSE as mt_rand().

I assume it's supposed to say "allows min to be larger than max"..

Test script:

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-02 11:37 UTC]
-Status: Open +Status: Duplicate
 [2017-05-02 11:37 UTC]
Duplicate of and already fixed.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Jan 22 15:03:34 2022 UTC