#44904 [Opn->Bgs]: mt_rand does not accept a single parameter but documented like it does
| From: | colder@php.net | Date: | Sat, 03 May 2008 16:09:22 +0000 |
| Subject: | #44904 [Opn->Bgs]: 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-785@lists.php.net to get a copy of this message | ||
ID: 44904
Updated by: colder@php.net
Reported By: twk at nonn-et-twk dot net
-Status: Open
+Status: Bogus
Bug Type: Documentation problem
Operating System: Windows
PHP Version: Irrelevant
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[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