ID: 6066 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Duplicate Bug Type: Misbehaving function Operating System: FreeBSD 4.1-Release PHP Version: 3.0.16 New Comment:
there's a more recent report ob php 4 behaviour Previous Comments: ------------------------------------------------------------------------ [2000-08-10 05:45:44] [EMAIL PROTECTED] There�s no information in the docs which logic shuffle() uses, should be added.... ------------------------------------------------------------------------ [2000-08-10 05:35:18] [EMAIL PROTECTED] Detailed description - an array of 8 elements, being shuffled repeatedly, with srand((double)microtime()*100000) being called each time, produces very unrandom results, namely, only 3 elements of 8 ever land in the first row (tested for 3x24hours). Testing platform was an installation of Tobias Ratschiller phpAds (I will be submitting a patch to it which gets rid of shuffle() RSN) While the same application (phpAds) using the same shuffle() method worked ok on Linux (2.2.x), I naively believe that actual implementation of shuffle() might be somehow improved, inctead of relying on system's random generator being nicely symmetrical (if I understood the implementation correctly). Replacing usage of system random generator with mt_rand (internally) might also be a good idea. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=6066&edit=1
