|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45531 description on rand() is wrong
Submitted: 2008-07-16 16:56 UTC Modified: 2008-07-21 09:13 UTC
From: wayne at emaildienst dot de Assigned:
Status: Closed Package: Translation problem
PHP Version: Irrelevant OS: none
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: wayne at emaildienst dot de
New email:
PHP Version: OS:


 [2008-07-16 16:56 UTC] wayne at emaildienst dot de
hi, following description is wrong:

int rand  ([ int $min  ], int $max  )

it should be:

int rand ([[int $min], int $max])

because all parameters are optional.

if there is only one given parameter, the function gets it as $max.
if there are two parameters given, the function gets the first as $min and the second as $max.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-16 17:41 UTC]
It looks correct to me in the english version of the manual; where are you seeing it like that? 

I can see it in the German translation, so I'll change the category to translation problem.
 [2008-07-16 19:43 UTC] wayne at emaildienst dot de

yes in the german documentation is the error.

and yes the english version is correct.

int rand  ( int $min  , int $max  )
is the correct description.
 [2008-07-21 09:13 UTC]
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 22 19:01:29 2024 UTC