From:             kingoleg at mail dot ru
Operating system: windows
PHP version:      4.3.4
PHP Bug Type:     Documentation problem
Bug description:  [chm and php.net] bug on function.rand.html

Description:
------------
I have found a bug on page http://www.php.net/manual/en/function.rand.php

[chm date: 2003-09-06]:

"On some platforms (such as Windows) RAND_MAX is only 32768. If you
require a range larger than 32768, consider using mt_rand() instead."

It is not correct for example on WinXp.





Reproduce code:
---------------
<?php

echo rand(11111111111111,222222222222222222);

?>

Expected result:
----------------
first run:

127534874 (it is >larger than 32768)

second run

59053744 (it is >larger than 32768)



Actual result:
--------------
I think, that word "range" in this note is from early PHP version, when
syntax was rand(start, rand). Now it rand(start, end).

I think, that words "such as Windows" must be replaced with "such as early
versions of Windows".

Or, this note can be fully rewrited.

-- 
Edit bug report at http://bugs.php.net/?id=27919&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27919&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27919&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27919&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27919&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27919&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27919&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27919&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27919&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27919&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27919&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27919&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27919&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27919&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27919&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27919&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27919&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27919&r=float

Reply via email to