Re: A patch to get rid of system rand/srand/etc.
| From: | Rasmus Lerdorf | Date: | Sat, 04 Aug 2001 05:35:06 +0000 |
| Subject: | Re: A patch to get rid of system rand/srand/etc. | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-62056@lists.php.net to get a copy of this message | ||
> >
> > This patch will replace PHP functions srand() / rand() / getrandmax()
> > with the mt_*() ones. The mt_*() are changed to aliases.
> >
> > If nobody objects, I will commit this tomorrow.
>
> I object. srand/rand are deterministic and usually portable
> algorithms (i.e. with the same seed, the return results of
> rand are the same) which certain programs rely on. There
> might be some scripts out there which use this feature,
> either for themselves or in order to communicate/synchronize
> with programs written in C.
I have code which relies on this in the regression test harness for it.
-Rasmus