Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pre-PHP 8.2 compatibility for php_mt_rand_range() with MT_RAND_PHP #9839

Merged
merged 3 commits into from
Oct 28, 2022

Commits on Oct 26, 2022

  1. Fix pre-PHP 8.2 compatibility for php_mt_rand_range() with MT_RAND_PHP

    As some left-over comments indicated:
    
    > Legacy mode deliberately not inside php_mt_rand_range()
    > to prevent other functions being affected
    
    The broken scaler was only used for `php_mt_rand_common()`, not
    `php_mt_rand_range()`. The former is only used for `mt_rand()`, whereas the
    latter is used for `array_rand()` and others.
    
    With the refactoring for the introduction of ext/random `php_mt_rand_common()`
    and `php_mt_rand_range()` were accidentally unified, thus introducing a
    behavioral change that was reported in FakerPHP/Faker#528.
    
    This commit moves the checks for `MT_RAND_PHP` from the general-purpose
    `range()` function back into `php_mt_rand_common()` and also into
    `Randomizer::getInt()` for drop-in compatibility with `mt_rand()`.
    TimWolla committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    b9bee15 View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2022

  1. Configuration menu
    Copy the full SHA
    795a6fc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4ee8493 View commit details
    Browse the repository at this point in the history