#19869 [Fbk->Csd]: bug in array_rand

From: Date: Sat, 12 Oct 2002 00:24:00 +0000
Subject: #19869 [Fbk->Csd]: bug in array_rand
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-22185@lists.php.net to get a copy of this message
ID: 19869 Updated by: edink@php.net Reported By: klashley@rtsg.uwi.tt -Status: Feedback +Status: Closed Bug Type: Scripting Engine problem Operating System: windows PHP Version: 4.2.2 New Comment: Thank you for your bug report. This issue has already been fixed in the latest released version of PHP, which you can download at http://www.php.net/downloads.php Previous Comments: ------------------------------------------------------------------------ [2002-10-11 15:04:38] sander@php.net Please try using this CVS snapshot: http://snaps.php.net/php4-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-latest.zip ------------------------------------------------------------------------ [2002-10-11 13:12:25] klashley@rtsg.uwi.tt I've found a bug with array_rand in PHP 4.2.2; it works in earlier versions, however when tested in newer PHP versions the output never changes. eg. srand ((double)microtime()*1000000); $backgrounds = range (1,28); $rand_keys = array_rand ($backgrounds, 3); print $backgrounds[$rand_keys[0]]."~".$backgrounds[$rand_keys[1]]."~".$backgrounds[$rand_keys[2]]; This would always for me produce the same results for me whatever I try. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19869&edit=1

« previous php.bugs (#22185) next »