|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9277 Bogus warning with rand(a,b) where a == b
Submitted: 2001-02-15 07:43 UTC Modified: 2001-02-19 14:14 UTC
From: jukkaho at mail dot student dot oulu dot fi Assigned:
Status: Closed Package: Math related
PHP Version: 4.0.4pl1 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jukkaho at mail dot student dot oulu dot fi
New email:
PHP Version: OS:


 [2001-02-15 07:43 UTC] jukkaho at mail dot student dot oulu dot fi

Gives "Warning: rand(): Invalid range: 0..0 in ..." while there is nothing wrong with it. Value shouldn't be invalid.

I'm expecting a value of 0 with probability of 100% without any warnings or is this a feature?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-15 13:04 UTC]
It's not a bug, it's clear that this was supposed not to work. And if you try rand (1,1) it wont work either.
Another thing; I don't see why this would be usefull.
 [2001-02-19 14:14 UTC]
After an e-mail comversation, Jukka made it clear it is useful, so I commit a "fix" to the CVS
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 29 02:01:30 2024 UTC