php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10837 The "rand" function doesn't work
Submitted: 2001-05-12 23:48 UTC Modified: 2001-06-21 23:39 UTC
From: huy91980 at pacbell dot net Assigned:
Status: Not a bug Package: Math related
PHP Version: 4.0.5 OS: Windows 2000 server
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: huy91980 at pacbell dot net
New email:
PHP Version: OS:

 

 [2001-05-12 23:48 UTC] huy91980 at pacbell dot net
calling: rand(1, 50)-1 will always get 1 !! try it for your self..this bug is only in 4.05  ..i imediately rolled back to 4.04pl1 and it works perfect again.

I didn't compile my module..downloaded the win32 build.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-13 04:48 UTC] derick@php.net
Works for me on Linux:

[derick@aarde seti]$ php -q
<?php
echo rand(1,50)-1;
echo "\n";
?>
27

Did you use srand to seed the random number generator?
(www.php.net/srand)

regards,
Derick
 [2001-05-13 04:49 UTC] derick@php.net
Status: Feedback
 [2001-06-21 23:39 UTC] sniper@php.net
No feedback, most likely user error.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC