-
Notifications
You must be signed in to change notification settings - Fork 7.9k
declare random globals #9576
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
declare random globals #9576
Conversation
also ping @laruence as this is for yar extension |
Good catch! I don't think this would work on Windows, though, where we would likely need something like php-src/ext/sockets/php_sockets.h Lines 55 to 65 in 31dca2e
|
@cmb69 I don't see the problem, PHPAPI is what is used in other ext, and is globally available https://github.com/php/php-src/blob/PHP-8.2/main/php.h#L58
P.S. also thinking about why we still have some specific PHP_xxx_API used instead of PHPAPI |
The general problem is that |
This change is likely appropriate for PHP 8.2 to minimize short-term breakage, but I'd like to point out that the global Mt19937 (and Mt19937 in general) really should not be used any longer. Extensions should probably switch to either:
|
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.
@remicollet
Thanks for finding it!
However, I don't understand why you are checking the seeding status in the yar Extension. It seems unnecessary since php_mt_rand() does seeding as needed.
I don't see any problem with the change, so I approve it
Thanks all Squashed and merged as 28a4d76 |
So other ext can use RANDOM_G macro
Ex: https://github.com/laruence/yar/blob/master/yar_request.c#L37