Doc #72830 [Opn->Ver]: mt_srand documentation
| From: | cmb@php.net | Date: | Mon, 15 Aug 2016 10:25:57 +0000 |
| Subject: | Doc #72830 [Opn->Ver]: mt_srand documentation | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-13810@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72830&edit=1
ID: 72830
Updated by: cmb@php.net
Reported by: montdm at montdm dot shost dot ca
Summary: mt_srand documentation
-Status: Open
+Status: Verified
Type: Documentation Problem
-Package: Documentation problem
+Package: Math related
Operating System: Windows
PHP Version: Irrelevant
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
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] <https://github.com/php/php-src/blob/PHP-7.0.10/ext/standard/rand.c#L244-L258>
Previous Comments:
------------------------------------------------------------------------
[2016-08-14 02:10:09] montdm at montdm dot shost dot ca
Description:
------------
Hi,
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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72830&edit=1