Random Extension 5.x needs follow-up

From: Date: Wed, 20 Jul 2022 14:24:12 +0000
Subject: Random Extension 5.x needs follow-up
Groups: php.internals 
Request: Send a blank email to internals+get-118290@lists.php.net to get a copy of this message
Hi Internals. The Random Extension 5.x and Random Extension Improvement RFCs have been passed and recently merged into the master branch. However, the proposal is still problematic and implementation fixes are needed. Currently, the mt_rand() function is overloading its arguments, and I have designed a Randomizer::getInt() signature based on this. However, argument overloading has several problems, including reflection, and is now not recommended. I wish I had been aware of it during the RFC proposal, but that did not happen. To solve the problem, I thought of separating the argumentless Randomizer::getInt() as Randomizer::nextInt(). Randomizer::getInt() must require int $min, int $max arguments. I have received support for this proposal from several people, but there will be a discrepancy between the RFC and the implementation. I believe this should be corrected to avoid future BC Break, what do you think about this? Discussions: - https://externals.io/message/118163#118269 - https://github.com/php/php-src/pull/8094/files#r919693108 (just scroll a little please) Fix PR: https://github.com/php/php-src/pull/9057 Best Regards Go Kudo

« previous php.internals (#118290) next »