Bug #53873 [Opn->Bgs]: Bug in rand()
Edit report at http://bugs.php.net/bug.php?id=53873&edit=1
ID: 53873
Updated by: felipe@php.net
Reported by: noel_fb at hotmail dot com
Summary: Bug in rand()
-Status: Open
+Status: Bogus
Type: Bug
Package: *General Issues
Operating System: Linux
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
This is because the 4294967295 is converted to long, hence...
var_dump((int)4294967295); // int(-1)
Previous Comments:
------------------------------------------------------------------------
[2011-01-28 22:26:24] noel_fb at hotmail dot com
Description:
------------
$codigo = rand(100,4294967295);
El valor de $CODIGO fue: 81
-----------------------------
$codigo = rand(100,4294967295);
the value of $CODIGO is: 81
---
From manual page: http://www.php.net/function.rand#Descripción
---
Test script:
---------------
$codigo = rand(100,4294967295);
El valor de $CODIGO fue: 81
-----------------------------
$codigo = rand(100,4294967295);
the value of $CODIGO is: 81
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53873&edit=1
Thread (2 messages)