ID: 11108
Updated by: andy
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Closed
Bug Type: Math related
Operating System: Windows 2000 SP2
PHP Version: 4.0.5
New Comment:

try using a better seed for the random number, such as

srand((double) microtime() * 1000000);

this fixed the problem on my machine.

Previous Comments:
------------------------------------------------------------------------

[2001-05-25 04:02:39] [EMAIL PROTECTED]

// Sample code for problem      
srand(time());
for($counter = 0; $counter<= 20 ; $counter++){
print(rand(0,5 );
print("<br>");
}

for some reason this always returns the same number as the first number returned, 
until the file is modified.  The first number, after that, the numbers seem to be 
random.  

I'm using the latest apache & php on a win2k SP2 laptop

------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=11108&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to