I would like to get the seed value after the rand() or mt_rand() is used. Essentially I want to store the seed so that I can use this seed to continue generating random numbers next time php is executed.
I need a repeatable behavior for unit testing/load testing... and different modules in my applications will use the same seed, so that the sequence of random numbers are generated are reproducible.
Thanks for your input. I couldn't find a method to get the seed. A Random number generator class that exposes the seed would be helpful too.
If you need repeatable behavior, you should seed
rand()ormt_rand()yourself usingsrand()ormt_srand()and store the seed that you use.