#44904 [Bgs->Csd]: mt_rand does not accept a single parameter but documented like it does
| From: | bjori@php.net | Date: | Sat, 03 May 2008 16:48:34 +0000 |
| Subject: | #44904 [Bgs->Csd]: mt_rand does not accept a single parameter but documented like it does | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-789@lists.php.net to get a copy of this message | ||
ID: 44904
Updated by: bjori@php.net
Reported By: twk at nonn-et-twk dot net
-Status: Bogus
+Status: Closed
Bug Type: Documentation problem
Operating System: Windows
PHP Version: Irrelevant
-Assigned To:
+Assigned To: bjori
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2008-05-03 16:10:27] colder@php.net
My bad, #44885
------------------------------------------------------------------------
[2008-05-03 16:09:22] colder@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same.
Thank you for your interest in PHP.
Same issue as #44855
------------------------------------------------------------------------
[2008-05-03 15:31:48] twk at nonn-et-twk dot net
Description:
------------
In mt_rand documentation,
http://docs.php.net/manual/en/function.mt-rand.php
http://php.net/manual/en/function.mt-rand.php
It seems the function accepts one or two parameters.
int mt_rand ([ int $min ], int $max )
However, it does not accept a single parameter,
but no or two parameters.
mt_rand($max); // genreates a warning.
Warning: mt_rand() expects exactly 2 parameters, 1 given
mt_rand() or mt_rand($min, $max) are ok.
The documented prototype should be same as rand()'s.
http://php.net/manual/en/function.rand.php
int rand ( void )
int rand ( int $min , int $max )
See also http://bugs.php.net/bug.php?id=12550
Reproduce code:
---------------
See http://docs.php.net/manual/en/function.mt-rand.php
Expected result:
----------------
int mt_rand ( void )
int mt_rand ( int $min , int $max )
(like http://php.net/manual/en/function.rand.php)
or
int mt_rand ([ int $min , int $max ])
Actual result:
--------------
int mt_rand ([ int $min ], int $max )
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44904&edit=1