Req #66718 [NEW]: Please add Mersenne Twister versions of shuffle and array_rand
From: php at barrayar dot org
Operating system: Any
PHP version: Irrelevant
Package: SPL related
Bug Type: Feature/Change Request
Bug description:Please add Mersenne Twister versions of shuffle and array_rand
Description:
------------
It would be very helpful if PHP had native Mersenne Twister equivalents
for all the various random functions, e.g. mt_shuffle, mt_array_rand.
(I'm not sure if there's any others that would be relevant.) The MT RNG
is superior to the regular srand/rand functions in all respects except
this one. While it's not that hard to implement mt_shuffle and
mt_array_rand equivalents in PHP, they would be faster and more
standardized if they were native.
(On a related note, it would also be helpful if PHP had a native class
for creating separate RNG pools, since sometimes you want to be able to
recreate a random sequence from a given seed, but since all mt_rand
calls use the same RNG pool, you can't have two concurrent RNG pools.)
--
Edit bug report at https://bugs.php.net/bug.php?id=66718&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66718&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66718&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66718&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66718&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66718&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66718&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66718&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66718&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66718&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66718&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66718&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66718&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66718&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66718&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66718&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66718&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66718&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66718&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66718&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66718&r=mysqlcfg
Thread (4 messages)
- php at barrayar dot org