note 87447 added to function.srand
| From: | Tom at osu1 dot php dot net | Date: | Fri, 05 Dec 2008 12:39:03 +0000 |
| Subject: | note 87447 added to function.srand | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-147676@lists.php.net to get a copy of this message | ||
It seems that the seed value isn't the only influence.
This:
> srand(1);
> print rand();
yields different results when called several times. So you can use srand() to create deterministic
random numbers... :-(
----
Server IP: 217.160.72.57
Probable Submitter: 80.133.65.29
----
Manual Page -- http://www.php.net/manual/en/function.srand.php
Edit -- https://master.php.net/note/edit/87447
Del: integrated -- https://master.php.net/note/delete/87447/integrated
Del: useless -- https://master.php.net/note/delete/87447/useless
Del: bad code -- https://master.php.net/note/delete/87447/bad+code
Del: spam -- https://master.php.net/note/delete/87447/spam
Del: non-english -- https://master.php.net/note/delete/87447/non-english
Del: in docs -- https://master.php.net/note/delete/87447/in+docs
Del: other reasons-- https://master.php.net/note/delete/87447
Reject -- https://master.php.net/note/reject/87447
Search -- https://master.php.net/manage/user-notes.php