...

View Full Version : help: mt_rand strange behaviour



Rokas
06-14-2005, 01:01 PM
I have such situation. There are a bit more than 10 random values generated in script. Some of them (10,80), some can even be (1,5000) (max value taken from db). But ~every 10-20 time it generates exactly the same set of values. All the other times it generates different set, but it seems like generator chose one set of values which are generated from time to time. I read in php.net that there is no need to seed the generator(using php 5.0.2). Any help?

mattyod
06-14-2005, 01:53 PM
Some of the comments in the livedocs on mt_rand() (http://livedocs.php.mirrors.powertrip.co.za/en/function.mt-rand.html) also mention problems with duplicate numbers on certain set ups.

Suggestions where using rand() instead or seeding with mt_srand() anyway.

G'luck.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum