We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d12b519 commit ca32959Copy full SHA for ca32959
ext/random/random.c
@@ -1858,12 +1858,12 @@ PHP_METHOD(Random_Randomizer, getInt)
1858
1859
if (argc == 0) {
1860
// right shift for compatibility
1861
- result = (zend_long) randomizer->algo->generate(randomizer->state, &engine_unsafe);
+ result = (zend_long) (randomizer->algo->generate(randomizer->state, &engine_unsafe) >> 1);
1862
if (engine_unsafe) {
1863
zend_throw_exception(spl_ce_RuntimeException, "Random number generate failed", 0);
1864
RETURN_THROWS();
1865
}
1866
- RETURN_LONG(result >> 1);
+ RETURN_LONG(result);
1867
1868
1869
ZEND_PARSE_PARAMETERS_START(2, 2)
0 commit comments