]> granicus.if.org Git - php/commit
Remove RAND_RANGE() macro
authorTom Van Looy <tom@ctors.net>
Sun, 3 Dec 2017 21:35:50 +0000 (22:35 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 9 Dec 2017 16:24:17 +0000 (17:24 +0100)
commite4e26f24285511c5aa2a359ff7e93c1748fdda3b
treeb3fa9519b3068603974c99a048d393e98009d2e3
parent6d4de4cf0582cf33848826ab78aae58077dc2dea
Remove RAND_RANGE() macro

The behavior of RANGE_RANGE() is 7.1 changed completely, from
rescaling an already generated number to generating a number
itself. Because of this str_shuffle() ended up generating two
random numbers on every iteration.

To avoid further misuse the function is dropped entirely. Extensions
for PHP >= 7.1 should directly call php_mt_rand_range().
UPGRADING.INTERNALS
ext/standard/array.c
ext/standard/php_rand.h
ext/standard/string.c