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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cmv at easydns dot com
New email:
PHP Version: OS:

 

 [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: Sat Jun 01 09:01:31 2024 UTC