Bug #16764: srand(microtime()) generates warning
| From: | heyjohnlim at yahoo dot com | Date: | Tue, 23 Apr 2002 19:11:32 +0000 |
| Subject: | Bug #16764: srand(microtime()) generates warning | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-5697@lists.php.net to get a copy of this message | ||
From: heyjohnlim@yahoo.com
Operating system: Win2000, IIS-CGI
PHP version: 4.2.0
PHP Bug Type: Unknown/Other Function
Bug description: srand(microtime()) generates warning
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 bug report at http://bugs.php.net/?id=16764&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=16764&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=16764&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=16764&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=16764&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16764&r=support
Expected behavior: http://bugs.php.net/fix.php?id=16764&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=16764&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=16764&r=submittedtwice