#44904 [NEW]: mt_rand does not accept a single parameter but documented like it does
| From: | twk at nonn-et-twk dot net | Date: | Sat, 03 May 2008 15:31:48 +0000 |
| Subject: | #44904 [NEW]: mt_rand does not accept a single parameter but documented like it does | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-783@lists.php.net to get a copy of this message | ||
From: twk at nonn-et-twk dot net
Operating system: Windows
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: mt_rand does not accept a single parameter but documented like it does
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 bug report at http://bugs.php.net/?id=44904&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44904&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44904&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44904&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=44904&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=44904&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=44904&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=44904&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=44904&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=44904&r=support
Expected behavior: http://bugs.php.net/fix.php?id=44904&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=44904&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=44904&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=44904&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44904&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=44904&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=44904&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=44904&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=44904&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=44904&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=44904&r=mysqlcfg