Date: 10/28/00
- Next message: Young, Christopher (HQP): "[PHP-DEV] RE: [Cvale-tech] here is the best one"
- Previous message: Whit: "Re: [PHP-DEV] Re: PHP 4.0 Bug #7396 Updated: is_dir() doesn't work"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
ID: 7492
Updated by: andrei
Reported By: tim <email protected>
Status: Closed
Bug Type: Arrays related
Assigned To:
Comments:
Fixed in CVS - thanks.
Previous Comments:
---------------------------------------------------------------------------
[2000-10-27 09:29:52] tim <email protected>
<!-- short reproducible error script
srand ((double) microtime() * 10000000);
$count = sizeof($files);
$rand_keys = array_rand ($files, $count);
reset ($files);
while (list ($key, $val) = each ($rand_keys)) {
echo "$key -> $val<br>n";
}
//-->
The nature of the bug is in tryign to create a random distribution of the entire array. The function works perfectly provided the second parameter to the array_rand function is less than the total number of elements. If the second parameter is equal to the total number of elements i nthe array, then the result of array_rand is identical to the initial array.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=7492
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Young, Christopher (HQP): "[PHP-DEV] RE: [Cvale-tech] here is the best one"
- Previous message: Whit: "Re: [PHP-DEV] Re: PHP 4.0 Bug #7396 Updated: is_dir() doesn't work"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

