rfc:random_extension_improvement

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:random_extension_improvement [2022/07/16 03:00] – finish zeriyoshirfc:random_extension_improvement [2022/07/22 09:55] (current) – reword two issues as the problem (VS the proposed solution) guilliamxavier
Line 3: Line 3:
   * Date: 2022-06-16   * Date: 2022-06-16
   * Author: Go Kudo <g-kudo@colopl.co.jp> <zeriyoshi@gmail.com>   * Author: Go Kudo <g-kudo@colopl.co.jp> <zeriyoshi@gmail.com>
-  * Status: Accepted Pending Implementation+  * Status: Implemented
   * First Published at: http://wiki.php.net/rfc/rng_extension   * First Published at: http://wiki.php.net/rfc/rng_extension
  
Line 36: Line 36:
 In order to preserve the implementation of the lcg_value() function, the internal implementation is retained, but the implementation as a class is being dropped to prevent users from unintentionally using it. In order to preserve the implementation of the lcg_value() function, the internal implementation is retained, but the implementation as a class is being dropped to prevent users from unintentionally using it.
  
-==== Add Randomizer::pickArrayKeys(array $array, int $num): array method ====+==== There is no equivalent of array_rand() ====
  
 <php>array_rand()</php> uses RNG internally, but there is no alternative method in ''Randomizer''. <php>array_rand()</php> uses RNG internally, but there is no alternative method in ''Randomizer''.
Line 67: Line 67:
 Therefore, it may be better to change the alternative method of str_shuffle(), ''Randomizer::shuffle**String**()'', to ''Randomizer::shuffle**Bytes**()''. This is a more appropriate name. Therefore, it may be better to change the alternative method of str_shuffle(), ''Randomizer::shuffle**String**()'', to ''Randomizer::shuffle**Bytes**()''. This is a more appropriate name.
  
-==== Refine classnames ====+==== Engine classnames are not precise ====
  
 To clearly identify the implemented algorithm, the PCG64 and MersenneTwister engines should be renamed to their canonical upstream name: To clearly identify the implemented algorithm, the PCG64 and MersenneTwister engines should be renamed to their canonical upstream name:
Line 106: Line 106:
 </doodle> </doodle>
  
-==== Add Randomizer::pickArrayKeys(array $array, int $num): array method ====+==== There is no equivalent of array_rand() ====
  
 <doodle title="Add the pickArrayKeys() method to the Randomizer?" auth="zeriyoshi" voteType="single" closed="true"> <doodle title="Add the pickArrayKeys() method to the Randomizer?" auth="zeriyoshi" voteType="single" closed="true">
Line 120: Line 120:
 </doodle> </doodle>
  
-==== Refine classnames ====+==== Engine classnames are not precise ====
  
 <doodle title="Rename PCG64 and MersenneTwister?" auth="zeriyoshi" voteType="single" closed="true"> <doodle title="Rename PCG64 and MersenneTwister?" auth="zeriyoshi" voteType="single" closed="true">
rfc/random_extension_improvement.1657940456.txt.gz · Last modified: 2022/07/16 03:00 by zeriyoshi