Re: rand() function not working right

From: Date: Sun, 31 Aug 2003 06:54:28 +0000
Subject: Re: rand() function not working right
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-161283@lists.php.net to get a copy of this message
I can confirm that the funtion works fine using php 4.3.0. on Mac OS X. While this may not be of any help, I will test on a later install on a test server. Thanks, John At 4:15 PM +1000 8/31/03, john wrote:
youre not the only one .. i just installed 4.3.3 and $x = rand(1,173); always returns 101 for $x i changed to mt_rand(1,173); and that always returns 142 ??? weirdness .. dont tell me this is happening to only me? ----- Original Message ----- From: <ldg@ulysium.net> To: "php general list" <php-general@lists.php.net> Sent: Thursday, May 29, 2003 4:29 AM Subject: [PHP] rand() function not working right
I'm using the latest php and the rand() function isn't working properly
when
giving it any min and max arguments. It does work without anything between the () but if I put a min and max, then only the min value always gets chosen. Is that a bug? Is that new? I'm not using an old php version, and it makes no difference to seed or
not.
I've switched to mt_rand() and it seems to work fine with min/max so far.. -- Didier Godefroy mailto:dg@ulysium.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- =========================== John T. Beresford Apple Certified Technical Coordinator http://www.deewi.com/ 405.760.0794

« previous php.general (#161283) next »