Hi
On 6/16/22 12:14, Go Kudo wrote:
If the content is acceptable, we would like to change the status of the RFC
to Under Discussion and make an
announcement thread to internals ML. Can anyone review the content?
(1) Engines should be final:
That was my suggestion and that paragraph looks good to me.
(2) array_rand():
That looks good to me. For the method name:
Perhaps ->pickArrayKey() for similarity with ->shuffleArray() which also
includes the type it operates on in the name?
(3) Naming of PCG64:
I must admit that the fact that PCG is a full family of similar, but not
identical generators is one thing that made me (and still makes me)
prefer the xoshiro family which has clearer names for its variants.
It was also pretty hard to find the PCG definitions on the PCG website,
but I believe that it refers to this:
https://www.pcg-random.org/using-pcg-c.html#low-level-api?
In that case PCG64S would be consistent with the upstream high level API
name. I am not sure if Pcg64s would be more readable, though.
It would definitely need a good explanation in the documentation which
exact variant it is, though.
(4) Randomizer::randomString($charset, $length)
If we extend the Randomizer anyway, I wonder if we also should use the
opportunity to add a method to generate a random string for a given
charset, e.g.
->randomString('0123456789abcdef', 6) would return a random hexadecimal
color code.
This does not yet exist in the standard library, but I am seeing that
many libraries implement something like that on their own, making it a
useful addition in my mind.
Best regards
Tim Düsterhus
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php