php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1133 rand() works additively now
Submitted: 1999-02-09 14:42 UTC Modified: 1999-02-21 14:51 UTC
From: cmv at easydns dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.6 OS: Linux
Private report: No CVE-ID: None
 [1999-02-09 14:42 UTC] cmv at easydns dot com
rand($a,$b) doesn't return values between $a and $b, it returns values between $a and ($a+$b).

Further, if $b<$a, it generates an error.

I think the error checking is correct, but the function should return values between $a and $b.  This worked fine in versions prior to 3.0.6 I think.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-02-21 14:51 UTC] jim
Rasmus fixed this in the latest CVS (and introduced
another bug, but that is reported seperately).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 04:01:34 2024 UTC