php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #74520 rand() - min/max documentation mismatch
Submitted: 2017-05-01 14:52 UTC Modified: 2017-05-02 07:17 UTC
From: molnarriso at gmail dot com Assigned: peehaa (profile)
Status: Closed 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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: molnarriso at gmail dot com
New email:
PHP Version: OS:

 

 [2017-05-01 14:52 UTC] molnarriso at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.rand
---
In second note box:

"...To preserve backwards compatibility rand() allows min to be smaller than max as opposed to returning FALSE as mt_rand()..."

This should actually be "...allows MAX to be smaller than MIN..." 

Expected result:
----------------
...To preserve backwards compatibility rand() allows max to be smaller than min as opposed to returning FALSE as mt_rand()...

Actual result:
--------------
...To preserve backwards compatibility rand() allows min to be smaller than max as opposed to returning FALSE as mt_rand()...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-01 15:13 UTC] kelunik@php.net
-Status: Open +Status: Verified
 [2017-05-01 15:13 UTC] kelunik@php.net
If you want to, you can directly contribute a fix by using https://edit.php.net/. :-)
 [2017-05-02 07:17 UTC] peehaa@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: peehaa
 [2017-05-02 07:17 UTC] peehaa@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 04:01:38 2025 UTC