3 ms·
No it depends on the language implementation, and in the PHP documentation you can read that at every execution the seed is automatically changed. So while in C
by antirez 18y ago
No it depends on the language implementation, and in the PHP documentation you can read that at every execution the seed is automatically changed. So while in C you may need srand(time(NULL)) in order to get a different set of pseudo random numbers for every program execution in PHP you need srand(CONSTANT) in order to get always the same set.
Conclusion: PHP is buggy on windows if it does not change the seed at every execution like it is stated in the specification (documentation actually that == specification for PHP).