mt_rand() behavior change is not in UPGRADING
| From: | Yasuo Ohgaki | Date: | Thu, 14 May 2015 08:13:08 +0000 |
| Subject: | mt_rand() behavior change is not in UPGRADING | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-86210@lists.php.net to get a copy of this message | ||
Hi all,
It's nice to see mt_rand() behavior is improved.
[yohgaki@dev ~]$ php-5.6 -r "var_dump(mt_rand(222,
'99999999999999999999999'));"
int(115282844144104926)
[yohgaki@dev ~]$ php-7.0 -r "var_dump(mt_rand(222,
'99999999999999999999999'));"
Warning: mt_rand() expects parameter 2 to be integer, string given in
Command line code on line 1
NULL
However, returning NULL for invalid range may result in serious issues.
It's not documented in UPGRADING.
Could anyone responsible take care of it?
I suppose mt_srand() behavior has changed also.
There may be others.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net