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/14 09:50] – add implementation link 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: Voting+  * 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 87: Line 87:
 ==== Engine implementations are not final ==== ==== Engine implementations are not final ====
  
-<doodle title="Make all implemented engines final?" auth="zeriyoshi" voteType="single" closed="false">+<doodle title="Make all implemented engines final?" auth="zeriyoshi" voteType="single" closed="true">
    * Yes    * Yes
    * No    * No
Line 94: Line 94:
 ==== Random\SerializableEngine is not useful ==== ==== Random\SerializableEngine is not useful ====
  
-<doodle title="Remove the SerializableEngine interface?" auth="zeriyoshi" voteType="single" closed="false">+<doodle title="Remove the SerializableEngine interface?" auth="zeriyoshi" voteType="single" closed="true">
    * Yes    * Yes
    * No    * No
Line 101: Line 101:
 ==== Random\Engine\CombinedLCG is low quality ==== ==== Random\Engine\CombinedLCG is low quality ====
  
-<doodle title="Remove the CombinedLCG class?" auth="zeriyoshi" voteType="single" closed="false">+<doodle title="Remove the CombinedLCG class?" auth="zeriyoshi" voteType="single" closed="true">
    * Yes    * Yes
    * No    * No
 </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="false">+<doodle title="Add the pickArrayKeys() method to the Randomizer?" auth="zeriyoshi" voteType="single" closed="true">
    * Yes    * Yes
    * No    * No
Line 115: Line 115:
 ==== "string" means a binary ==== ==== "string" means a binary ====
  
-<doodle title="Rename Randomizer::shuffleString() to Randomizer::shuffleBytes()?" auth="zeriyoshi" voteType="single" closed="false">+<doodle title="Rename Randomizer::shuffleString() to Randomizer::shuffleBytes()?" auth="zeriyoshi" voteType="single" closed="true">
    * Yes    * Yes
    * No    * No
 </doodle> </doodle>
  
-==== Refine classnames ====+==== Engine classnames are not precise ====
  
-<doodle title="Rename PCG64 and MersenneTwister?" auth="zeriyoshi" voteType="single" closed="false">+<doodle title="Rename PCG64 and MersenneTwister?" auth="zeriyoshi" voteType="single" closed="true">
    * Yes    * Yes
    * No    * No
Line 129: Line 129:
 ==== PCG is not so famous ==== ==== PCG is not so famous ====
  
-<doodle title="Add the Xoshiro256StarStar engine and class?" auth="zeriyoshi" voteType="single" closed="false">+<doodle title="Add the Xoshiro256StarStar engine and class?" auth="zeriyoshi" voteType="single" closed="true">
    * Yes    * Yes
    * No    * No
rfc/random_extension_improvement.1657792226.txt.gz · Last modified: 2022/07/14 09:50 by zeriyoshi