From:             [EMAIL PROTECTED]
Operating system: windows
PHP version:      4.2.2
PHP Bug Type:     Scripting Engine problem
Bug description:  bug in array_rand

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 bug report at http://bugs.php.net/?id=19869&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=19869&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=19869&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=19869&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=19869&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=19869&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=19869&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=19869&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=19869&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=19869&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=19869&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=19869&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=19869&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=19869&r=isapi

Reply via email to