Re: Seeding for php functions
| From: | Richard Lynch | Date: | Mon, 26 Aug 2002 21:52:14 +0000 |
| Subject: | Re: Seeding for php functions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-114179@lists.php.net to get a copy of this message | ||
>Im using array_rand() and shuffle() in my scripts.
>Im seeding using mt_srand().
>I noticed the manual didn't suggest that mt_srand() can be used to seed
>array_rand() and shuffle() but the older srand().
>The mt_srand man page states that its a drop in replacement for srand().
>I just would like to double check with the gurus that mt_srand() can be
>used to seed array_rand() and shuffle().
Most likely mt_srand() will not affect array_rand() and shuffle().
MT_ is a "drop-in" replacement, but it's a "package deal" that you replace
rand/srand with mt_rand/mt_srand.
It won't change the underlying code within array_rand() and shuffle()
On the plus side, PHP has automatically seeded the random numbers for
several versions now...
Don't know for 100% sure that that applies to array_rand and/or shuffle,
however -- Perhaps only built-in seeding for rand() and/or mt_srand()
--
Like Music? http://l-i-e.com/artists.htm