random_compat icon indicating copy to clipboard operation
random_compat copied to clipboard

Probably not what you were looking for...

Open davedevelopment opened this issue 12 years ago • 1 comments

...but the first thing I saw was the boolean constructor argument and I didn't like it :)

Not sure this is the best fix for it, but you get the idea.

Everything else looks good to me.

davedevelopment avatar Aug 22 '13 16:08 davedevelopment

:-1: The suggested SecureRandom class breaks the contract Random imposes. Though PHP does not require compatible constructor declarations, IMHO, it's a bad idea to have extensions set a bad example. Child classes can only add optional arguments, but they can't enforce different/stricter type requirements and all that (The Liskov principle)

EVODelavega avatar Mar 10 '15 14:03 EVODelavega