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
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: 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

Add a Patch

Pull Requests

Add a Pull Request

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-2019 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 07:01:24 2019 UTC