From: Leigh Date: Thu, 18 Feb 2016 11:25:15 +0000 (+0000) Subject: Merge branch 'PHP-7.0' X-Git-Tag: php-7.1.0alpha1~607 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=50482d66e024c5f4beb8dbe04cc88d99f313a8f3;p=php Merge branch 'PHP-7.0' * PHP-7.0: Revert "Fix #71152: mt_rand() returns the different values from original mt19937ar.c" `mt_rand()` is seedable with `mt_srand()` which means it can be used to (re)produce specific streams of numbers. All code (no matter how few instances that may be) that previously depended on this behaviour will no longer produce the same results. This kind of change needs to be discussed before being committed --- 50482d66e024c5f4beb8dbe04cc88d99f313a8f3 diff --cc ext/standard/rand.c index 13b3dcd518,2dd05e70bb..50729f2418 --- a/ext/standard/rand.c +++ b/ext/standard/rand.c @@@ -146,7 -146,7 +146,7 @@@ PHPAPI zend_long php_rand(void #define loBits(u) ((u) & 0x7FFFFFFFU) /* mask the highest bit of u */ #define mixBits(u, v) (hiBit(u)|loBits(v)) /* move hi bit of u to hi bit of v */ - #define twist(m,u,v) (m ^ (mixBits(u,v)>>1) ^ ((uint32_t)(-(int32_t)(loBit(v))) & 0x9908b0dfU)) -#define twist(m,u,v) (m ^ (mixBits(u,v)>>1) ^ ((php_uint32)(-(php_int32)(loBit(u))) & 0x9908b0dfU)) ++#define twist(m,u,v) (m ^ (mixBits(u,v)>>1) ^ ((uint32_t)(-(int32_t)(loBit(u))) & 0x9908b0dfU)) /* {{{ php_mt_initialize */