Emulating shuffle function

In PHP 7.1 , PHP changed the internal randomization algorithm of the shuffle() function and related functions.

technically, this is a more correct randomizer, but it changed how things get shuffled.

When something has been a certain way for years, the change has been an issue to me.

Upon reading some, the mt_srand() function now has a flag to use for backwards compatibility.

My question is how can I use this to emulate the old shuffle function so it works the way it used to prior to PHP 7.1?

Im no pro but maybe look into this regarding your function; https://www.php.net/manual/en/function.mt-srand.php

Try mt_rand() ??

What are you trying to do, that your code relies on a certain shuffling algorithm?

Sponsor our Newsletter | Privacy Policy | Terms of Service