php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #18419 No way to get current rand seed
Submitted: 2002-07-18 15:17 UTC Modified: 2002-09-11 12:07 UTC
From: peter_ammon at rocketmail dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.2.1 OS: RedHat Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: peter_ammon at rocketmail dot com
New email:
PHP Version: OS:

 

 [2002-07-18 15:17 UTC] peter_ammon at rocketmail dot com
It would be nice if there were a way to retrieve the 
current random number seed (or state if it maintains more 
information than just the seed), so the random number 
generator could be reseeded with it.  Some code depends 
upon the fact that rand will produce the same sequence 
starting with a given seed, and without a way to retrieve 
the seed, it's impossible to put functions that call rand() 
a variable number of times in such code.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-18 15:20 UTC] rasmus@php.net
I don't really see the scenario where setting a known seed with srand() wouldn't be sufficient.
 [2002-09-11 12:07 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Jun 17 20:00:01 2026 UTC