Req #66728 [NEW]: gmp_random is obsolete, switch to gmp_urandomm

From: Date: Mon, 17 Feb 2014 20:52:47 +0000
Subject: Req #66728 [NEW]: gmp_random is obsolete, switch to gmp_urandomm
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184337@lists.php.net to get a copy of this message
From: asphp at dsgml dot com Operating system: PHP version: Irrelevant Package: GNU MP related Bug Type: Feature/Change Request Bug description:gmp_random is obsolete, switch to gmp_urandomm Description: ------------ According to the docs mpz_random (i.e. gmp_random) is obsolete. It's also pretty useless since it returns digits in an undefined range. Instead switch to mpz_urandomm which lets you specify the max directly. PHP could either expose it as is and let people subtract to get the min, or PHP could make it easier and let people specify a min and max. PHP could require that people manually initialize the random state, or just go ahead and do it for them with gmp_randinit_mt. Also once this is a done a PHP warning should be emitted for use of gmp_random. See: https://gmplib.org/manual/Integer-Random-Numbers.html -- Edit bug report at https://bugs.php.net/bug.php?id=66728&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66728&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66728&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66728&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=66728&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=66728&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=66728&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=66728&r=needscript Try newer version: https://bugs.php.net/fix.php?id=66728&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=66728&r=support Expected behavior: https://bugs.php.net/fix.php?id=66728&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=66728&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=66728&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=66728&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66728&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=66728&r=dst IIS Stability: https://bugs.php.net/fix.php?id=66728&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=66728&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=66728&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=66728&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=66728&r=mysqlcfg

« previous php.bugs (#184337) next »