#19869 [NEW]: bug in array_rand
| From: | klashley at rtsg dot uwi dot tt | Date: | Fri, 11 Oct 2002 18:12:25 +0000 |
| Subject: | #19869 [NEW]: bug in array_rand | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-22170@lists.php.net to get a copy of this message | ||
From: klashley@rtsg.uwi.tt
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