On Thu, May 14, 2015 at 10:13 AM, Yasuo Ohgaki <yohg...@ohgaki.net> wrote:

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

This change is not mt_rand specific, it applies to all internal functions.
See https://wiki.php.net/rfc/zpp_fail_on_overflow. You are right that it is
not mentioned in UPGRADING yet.

Nikita

Reply via email to