Req #12312 [Opn->Wfx]: Add array_mt_rand()

From: Date: Tue, 17 Feb 2015 09:03:19 +0000
Subject: Req #12312 [Opn->Wfx]: Add array_mt_rand()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190735@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=12312&edit=1 ID: 12312 Updated by: krakjoe@php.net Reported by: lramsey at crystalorb dot net Summary: Add array_mt_rand() -Status: Open +Status: Wont fix Type: Feature/Change Request Package: Arrays related Operating System: * PHP Version: * Block user comment: N Private report: N New Comment: array_rand does still use the same random number generator today, I checked. What was true in 2003, is still true today in 2015, it would be a breaking change. The introduction of a new function today requires an RFC, I'm therefore marking the bug as won't fix. This report can still be found if some future RFC is started for the inclusion of the suggested function. Sorry about the wait. Previous Comments: ------------------------------------------------------------------------ [2003-06-25 12:02:34] jay@php.net There's a patch for php-src HEAD at http://bugs.tutorbuddy.com/download.php/php5.array_mt_rand.patch Adds array_mt_rand(). Rewriting the existing functions would be bad for BC if anybody is relying on their current behaviour. J ------------------------------------------------------------------------ [2003-06-06 17:33:04] philip@php.net Why not just rewrite array_rand() and shuffle() to instead use mt_srand()? It is "superior" after all... And seeding takes place automatically as of PHP 4.2.0 ------------------------------------------------------------------------ [2003-06-06 14:54:06] sniper@php.net There is no 'array_shuffle()' and shuffle() uses rand too. Having array_mt_rand() is quite good idea. ------------------------------------------------------------------------ [2003-05-31 10:37:15] andrey@php.net Does array_shuffle() solve this? ------------------------------------------------------------------------ [2001-07-22 21:23:20] lramsey at crystalorb dot net As the mt_rand() algorithim creates better random numbers than rand(), would it be possible to include in future releases of the language to include a version of array_rand() that uses mt_rand()? ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=12312&edit=1

« previous php.bugs (#190735) next »