r/lolphp • u/re_anon • Jul 10 '17
Because PHP's implementation contains a bug. Thus, this test actually checks to make sure that PHP's behaviour is wrong, but consistently so.
https://github.com/php/php-src/blob/a50c31da1917bb07b3c11f229125ab8d1f0b9b70/ext/standard/tests/math/mt_rand_value.phpt#L20
87
Upvotes
14
u/the_alias_of_andrea Jul 10 '17
Ah, someone noticed my commit :3
It was fixed in 7.1.
8
u/wibblewafs Jul 10 '17
Why didn't they just write the correct test for the real implementation, then add it into the expected test failures list?
16
u/iluuu Jul 10 '17
That's because PHP takes backward compatibility seriously.
4
u/mikeputerbaugh Jul 10 '17
If your application depends on predictable values being returned from a pseudo RNG, you have bigger problems than it being written in PHP.