|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #72830 mt_srand documentation
Submitted: 2016-08-14 02:10 UTC Modified: 2016-08-15 10:40 UTC
From: montdm at montdm dot shost dot ca Assigned: cmb (profile)
Status: Closed Package: Math related
PHP Version: Irrelevant OS: Windows
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: montdm at montdm dot shost dot ca
New email:
PHP Version: OS:


 [2016-08-14 02:10 UTC] montdm at montdm dot shost dot ca

On your website for the mt_srand (in english and in french), you have writen in the "description" section :
void mt_srand ([ int $seed ] )

= I understand that the 'seed' has to be an int value

In the "parameters" section :
seed : an optional seed value (english version)
seed : une valeur d'initialisation aléatoire (french version)

= no explanation about what is the "value" or "valeur"

And in the "examples" section "Example #1 mt_srand() example" :

the make_seed function returns a float !

What should be the "value" ? A (int) or a (float) ?
It will be great if the 3 sections "description", "parameters" and "examples" were coherent

Best regards


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-15 10:25 UTC]
-Status: Open +Status: Verified -Package: Documentation problem +Package: Math related -Assigned To: +Assigned To: cmb
 [2016-08-15 10:25 UTC]
Indeed, the example doesn't make sense.

mt_srand() expects an integer value[1], so basically anything
between PHP_INT_MIN and PHP_INT_MAX. However, this value will be
passed to php_mt_srand() which expects an unsigned integer, so
negative values will overflow, what doesn't appear to be a
particular issue in this case.

[1] <>
 [2016-08-15 10:39 UTC]
Automatic comment from SVN on behalf of cmb
Log: Fix #72830: mt_srand documentation
 [2016-08-15 10:40 UTC]
-Status: Verified +Status: Closed
 [2016-08-15 10:40 UTC]
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2020-02-07 06:06 UTC]
Automatic comment on behalf of cmb
Log: Fix #72830: mt_srand documentation
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Feb 09 03:03:40 2023 UTC