Bug #16764 Updated: srand(microtime()) generates warning
| From: | derick@php.net | Date: | Tue, 23 Apr 2002 19:16:52 +0000 |
| Subject: | Bug #16764 Updated: srand(microtime()) generates warning | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-5699@lists.php.net to get a copy of this message | ||
ID: 16764
Updated by: derick@php.net
Reported By: heyjohnlim@yahoo.com
-Status: Open
+Status: Bogus
Bug Type: Unknown/Other Function
Operating System: Win2000, IIS-CGI
PHP Version: 4.2.0
New Comment:
INdeed was stricter type chcking implemented.
This should work:
srand ((int) microtime());
Derick
Previous Comments:
------------------------------------------------------------------------
[2002-04-23 15:11:31] heyjohnlim@yahoo.com
Is this a bug, or is microtime implementing stricter type checking?
After all most faq's list this as the recommended way of generating a
seed.
<?php
srand(microtime());
?>
Generates:
Warning: srand() expects parameter 1 to be long, string given in
d:\inetpub\wwwroot\php\test.php on line 2
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16764&edit=1