Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31105 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4166 invoked by uid 1010); 19 Jul 2007 17:09:35 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 4151 invoked from network); 19 Jul 2007 17:09:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jul 2007 17:09:35 -0000 Authentication-Results: pb1.pair.com header.from=david.coallier@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=david.coallier@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.184.224 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: david.coallier@gmail.com X-Host-Fingerprint: 64.233.184.224 wr-out-0506.google.com Linux 2.4/2.6 Received: from [64.233.184.224] ([64.233.184.224:9239] helo=wr-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A3/F1-21764-CCA9F964 for ; Thu, 19 Jul 2007 13:09:33 -0400 Received: by wr-out-0506.google.com with SMTP id q50so521188wrq for ; Thu, 19 Jul 2007 10:09:29 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=kFdxZ9UhcLDDEis6QzsOMsEla9CU4rzzqBJ1k/PXgoAXGJvIHKFaUa4jWCI/U9ZpAWk7GbZEZ+XB9yI3c1wN0eb8EtfWjjlSYEICigZ/Y/1s7sga62I5xf8mTSCWgA48OmA9yQCNsGSPl628KLVQhSINU1NY5TiNuc/8CmdInys= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=in+7ovJ/5WFDhBD2qrglsFxd3mPFpiT1sIh4vq895A4k07NbAMzmLA+5DcOzlaHVB7pcEdMmtb3gqNFlcSw8BbEbNnqCYfr77fJXAE6IJexo3b3xFSg1hVwu1MTUK57R32jif5vdK4G2vfS0tDYGENuczPrEvQ8L9MWDoJdxp74= Received: by 10.90.75.10 with SMTP id x10mr3114308aga.1184864969196; Thu, 19 Jul 2007 10:09:29 -0700 (PDT) Received: by 10.90.96.12 with HTTP; Thu, 19 Jul 2007 10:09:29 -0700 (PDT) Message-ID: Date: Thu, 19 Jul 2007 13:09:29 -0400 Sender: david.coallier@gmail.com To: "Antony Dovgal" Cc: "Keryx Web" , internals@lists.php.net In-Reply-To: <469F6EE1.7080104@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <469E59FA.6060104@keryx.se> <0E62C134-68DF-4240-81BB-3A3EEA0E293D@prohost.org> <469F6A09.2050909@keryx.se> <469F6EE1.7080104@zend.com> X-Google-Sender-Auth: d632f7e54a39dd11 Subject: Re: [PHP-DEV] libc and random functions From: davidc@php.net ("David Coallier") On 7/19/07, Antony Dovgal wrote: > On 19.07.2007 17:41, Keryx Web wrote: > > Ilia Alshanetsky wrote: > >> Do you have a patch? > > > > Also @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.php > > 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.diff [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