-
Notifications
You must be signed in to change notification settings - Fork 8k
random: Fix unknown mt_srand() compatibility for unknown modes
#13544
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
Conversation
PHP 8.1 and below interpreted unknown modes as `MT_RAND_MT19937`, but PHP 8.2+ interprets them as `MT_RAND_PHP`. Align the behavior with PHP 8.1 and below, because folks should be steered towards the standard mode.
8bf70af to
03bef8d
Compare
|
Duh. Forgot to |
Girgias
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, might make sense to make this a ValueError in master.
|
Apparently PHP 8.2.17 was branched off after creating the PR and before merging it, placing the NEWS in the wrong location.
* PHP-8.2: [ci skip] Fix version for GH-13544 in NEWS
* PHP-8.3: [ci skip] Fix version for GH-13544 in NEWS
see: https://3v4l.org/fOZbQ. Will need some adjustments when merging to PHP 8.3, due to the deprecation.
Found, because I wondered about the implicit downcast from
zend_longtouint8_tduring the assignment ofmodeand wondered about that, because I contemplated making the two mode constants and enum in PHP 8.4+.PHP 8.1 and below interpreted unknown modes as
MT_RAND_MT19937, but PHP 8.2+ interprets them asMT_RAND_PHP.Align the behavior with PHP 8.1 and below, because folks should be steered towards the standard mode.