Bug #16926 Updated: Shuffle doesn't work

From: Date: Wed, 01 May 2002 07:08:01 +0000
Subject: Bug #16926 Updated: Shuffle doesn't work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-6611@lists.php.net to get a copy of this message
ID: 16926 Updated by: derick@php.net Reported By: joseppo@hotmail.com -Status: Open +Status: Feedback Bug Type: *Math Functions Operating System: WinXP PHP Version: 4.2.0 New Comment: I could not reproduce this, are you sure the browser is not caching your page? Derick Previous Comments: ------------------------------------------------------------------------ [2002-04-30 08:14:09] joseppo@hotmail.com As of PHP 4.2.0, shuffle() doesn't seem to work for me. The following code always produce the same output: function make_seed() { // Taken directly from the manual list($usec, $sec) = explode(' ', microtime()); return (float) $sec + ((float) $usec * 100000); } srand(make_seed()); $arr = range(1, 10); shuffle($arr); print_r($arr); Further testing shows that I get the same output if I uncomment the srand(), if that's any help. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=16926&edit=1

« previous php.bugs (#6611) next »