-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[RFC] Random extension #7453
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
[RFC] Random extension #7453
Conversation
7a4ef6c
to
50dd7d7
Compare
e968bba
to
d3a8487
Compare
tests/*/*.php | ||
tests/*/*.exp | ||
tests/*/*.log | ||
tests/*/*.sh |
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.
This file can be dropped, top-level .gitignore should be enough.
namespace | ||
{ | ||
|
||
function lcg_value(): float {} |
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.
Why are these functions being moved? This part of the change doesn't look necessary to me. Does keeping these functions in ext/standard cause any problems?
|
||
function random_int(int $min, int $max): int {} | ||
|
||
final class Random |
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.
As far as I saw, our namespace policy doesn't have a guideline about this, but in my opinion, it would be better to put this class into the Random
namespace.
namespace Random | ||
{ | ||
|
||
abstract class NumberGenerator |
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.
What do you think about making NumberGenerator
an interface instead, since it doesn't have any behavior? It would be useful IMO, since userland implementations could extend whatever they want.
- I'd put the interface into the
Random\NumberGenerator
namespace.
As I got this extensions can't be build as shared? |
There's typo at https://wiki.php.net/rfc/rng_extension |
Close to restructure this RFC and implementation. |
RFC: https://wiki.php.net/rfc/rng_extension