note 38675 deleted from function.srand by nlopess
| From: | nlopess@php.net | Date: | Fri, 02 Jan 2004 15:24:45 +0000 |
| Subject: | note 38675 deleted from function.srand by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-62790@lists.php.net to get a copy of this message | ||
Note Submitter: r1ffe@nospam.hotmail.com
----
Just wanted people to know that I recently upgraded from PHP 4.3.2 to PHP 4.3.4 (on IIS 5) and my
random number generator does NOT seem to be automatically seeded, as stated in the documentation
above.
On one of my sites, I display images based upon rand(1, 75) for the output, which gives me something
like 43.gif, for instance. This has always given me different images on each reload, until i
switched to PHP 4.3.4.
What I did was to simply seed the random number generator with srand((double)microtime() * 1000000)
once, in the beginning of my scripts.
But my point is that nowadays, using 4.3.4, I have too manually seed it.