Re: libc and random functions
| From: | David Coallier | Date: | Thu, 19 Jul 2007 17:09:29 +0000 |
| Subject: | Re: libc and random functions | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-31105@lists.php.net to get a copy of this message | ||
On 7/19/07, Antony Dovgal <antony@zend.com> wrote:
On 19.07.2007 17:41, Keryx Web wrote: Ilia Alshanetsky wrote:Here are three patches against HEAD [1], 5_2 [2] and the pecl repository [3] (Do not shout just yet, I'll explain). The idea of the patches are pretty simple, aliasing rand, srand, getrandmax to mt_rand, mt_srand, and mt_getrandmax. The goal is simply having a better number generation. Nothing fancier, or more different, but simply it. It works great (compiling great against 5_2, HEAD) and Crisitan Rodriguez also tried the compilation. After a bit of discussion with Jani, I came to realize that keeping the wrapper macro for php_rand, php_srand is plain useless. Yes some pecl extensions do rely on them (and for those who do, I also provided a patch [3]). We both realized that there's not many extensions relying on php_rand and php_srand thus removed it completely.. Here are the patches: [1] HEAD : http://dev.agoraproduction.com/php/php6/head-mt-changes.diffAlso @Antony Dovgal in the "let blocks" thread Short answer: No. The reason I posted my suggestions on this list was that a while ago I had a few ideas as to how PHP could be improved. What I don't understand about the crypt thing you propose - is what problem are you trying to fix this way? If there are no problems, then please don't improve anything not broken. "No reasons to keep it" is wrong, there is at least one reason to keep it as is - it works fine. -- Wbr, Antony Dovgal -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.phpDo you have a patch?
[2] 5_2 : http://dev.agoraproduction.com/php/5_2/5.2-mt-changes.diff[3] PECL : http://dev.agoraproduction.com/php/php6/pecl-mt-changes.diff Please note that the mt-changes patches are not only changing ext/standard/* but also the ext/* relying on them. (soap, mcrypt) but also a small change in main/reentrancy.c both in 5_2 and HEAD. Thanks, -- David Coallier, Founder & Software Architect, Agora Production (http://agoraproduction.com) 51.42.06.70.18