#44904 [Bgs]: mt_rand does not accept a single parameter but documented like it does

From: Date: Sat, 03 May 2008 16:10:27 +0000
Subject: #44904 [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-787@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: Bogus Bug Type: Documentation problem Operating System: Windows PHP Version: Irrelevant New Comment: My bad, #44885 Previous Comments: ------------------------------------------------------------------------ [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

« previous php.doc.bugs (#787) next »