Bug #9823 Updated: srand() -- seed should default to (double)microtime()*1000000
| From: | jimw@php.net | Date: | Sat, 27 Apr 2002 19:08:47 +0000 |
| Subject: | Bug #9823 Updated: srand() -- seed should default to (double)microtime()*1000000 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-6273@lists.php.net to get a copy of this message | ||
ID: 9823
Updated by: jimw@php.net
Reported By: ryland@ryland.net
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
Operating System: all
PHP Version: 4.0.4pl1
New Comment:
the seed is optional and php generates a 'good' one.
Previous Comments:
------------------------------------------------------------------------
[2001-03-18 16:25:03] ryland@ryland.net
In the user notes for srand(), richard@zend.com said:
>*ALWAYS* use (double)microtime()*1000000 as your seed.
>Do *NOT* just use time(). Do not add an extra 0 to make it "bigger".
...
>Anything else is sub-standard.
If so, why not make the seed argument optional, and make the default
(double)microtime()*1000000 when the argument is absent? Save me a
few keystrokes, anyway, and help make sure people don't do it in a
"sub-standard" fashion... :)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=9823&edit=1