#24909 [Opn->Csd]: rand function with range always returns low value of range

From: Date: Fri, 08 Aug 2003 13:36:01 +0000
Subject: #24909 [Opn->Csd]: rand function with range always returns low value of range
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-45580@lists.php.net to get a copy of this message
ID: 24909 Updated by: iliaa@php.net Reported By: a0 at hush dot com -Status: Open +Status: Closed Bug Type: Math related Operating System: solaris 8 PHP Version: 4.3.3RC3-dev New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2003-08-07 15:48:12] thetaphi@php.net This Test seems to be related to that: ======================================================= ============== FAILED TEST SUMMARY ------------------------------------------------------- -------------- Testing randomization of shuffle() and str_shuffle(). [ext/standard/tests/strings/004.phpt] ======================================================= ============== You get it only in ZTS mode. ------------------------------------------------------------------------ [2003-08-04 12:18:53] a0 at hush dot com i configured and built as you specified Build complete. (It is safe to ignore warnings about tempnam and tmpnam). bash-2.05# sapi/cli/php -r 'echo rand(),"\n"; echo rand(0,100),"\n";' 16162 0 bash-2.05# sapi/cli/php -r 'echo rand(),"\n"; echo rand(0,100),"\n";' 31971 0 bash-2.05# ------------------------------------------------------------------------ [2003-08-04 08:39:37] sniper@php.net Please try this: # rm config.cache # ./configure --disable-all --disable-cgi --enable-experimental-zts # make clean && make # sapi/cli/php -r 'echo rand(),"\n"; echo rand(0,100),"\n";' ------------------------------------------------------------------------ [2003-08-02 15:17:29] a0 at hush dot com i used the cli binary in both cases ------------------------------------------------------------------------ [2003-08-02 15:00:52] iliaa@php.net I've tried the ZTS version on both Linux & Windows and it worked perfectly in both cases. Did you run test via the nsapi module or using PHP cli or cgi binaries? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/24909 -- Edit this bug report at http://bugs.php.net/?id=24909&edit=1

« previous php.bugs (#45580) next »