Hi all, We have issue on pseudo random generators generates only odd/even numbers.
https://bugs.php.net/bug.php?id=63174 https://news.ycombinator.com/item?id=9941364 We should raise E_WARNING/E_NOTICE if user supplies random number range that generated random number cannot be random at least. Patch for rand/mt_rand. https://gist.github.com/yohgaki/1519f65dffd66735bafe It seems we need more reliable(fool proof) pseudo random generator. Anyone working on this? We may extends rand()/mt_rand() so that they work with larger range by calling random generators multiple times. If this is implemented, the patch raises errors is not required. mt_rand() extension breaks compatibility with other MT rand implementations, but we already broke it. Therefore, it should not matter. (This was the reason why mt_rand() wasn't made to support 64bit int, IIRC) IMO, we should provide better pseudo random generators than now. Any comments? P.S. I think we should fix mt_rand() to be true MT rand. Function named mt_rand() is not being MT rand is not a nice thing to keep _forever_. -- Yasuo Ohgaki yohg...@ohgaki.net -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php