Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94004 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29216 invoked from network); 15 Jun 2016 12:41:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jun 2016 12:41:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=fsb@thefsb.org; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=fsb@thefsb.org; sender-id=pass Received-SPF: pass (pb1.pair.com: domain thefsb.org designates 173.203.187.107 as permitted sender) X-PHP-List-Original-Sender: fsb@thefsb.org X-Host-Fingerprint: 173.203.187.107 smtp107.iad3a.emailsrvr.com Linux 2.6 Received: from [173.203.187.107] ([173.203.187.107:36390] helo=smtp107.iad3a.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 66/BF-27860-2FC41675 for ; Wed, 15 Jun 2016 08:41:24 -0400 Received: from smtp22.relay.iad3a.emailsrvr.com (localhost.localdomain [127.0.0.1]) by smtp22.relay.iad3a.emailsrvr.com (SMTP Server) with ESMTP id 861773805A9; Wed, 15 Jun 2016 08:41:20 -0400 (EDT) X-Auth-ID: fsb@thefsb.org Received: by smtp22.relay.iad3a.emailsrvr.com (Authenticated sender: fsb-AT-thefsb.org) with ESMTPSA id 5CC4B380472; Wed, 15 Jun 2016 08:41:20 -0400 (EDT) X-Sender-Id: fsb@thefsb.org Received: from yossy.local (c-66-30-62-12.hsd1.ma.comcast.net [66.30.62.12]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:587 (trex/5.5.4); Wed, 15 Jun 2016 08:41:20 -0400 To: Pierre Joye , Leigh References: Cc: PHP internals Message-ID: <0df5eed8-5240-8dfe-f7f3-acf551eadb6d@thefsb.org> Date: Wed, 15 Jun 2016 08:41:15 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] RNG fixes From: fsb@thefsb.org (Tom Worster) On 6/15/16 6:33 AM, Pierre Joye wrote: >> > * Alternatively, fixing the current mt_rand() implementation to make it >> > standard > That sounds more reasonable. An option (please no ini as it is a > programatic flow feature, not a php configuration problem) to keep the > old behavior for BC. Having to add an option for 7.1 or 7.2+ is > reasonable enough for the cases where the current seed and predictable > sequences are desired (same data generations for example using one > seed for example). > Hi Pierre, I'm glad you mentioned a compatibility mode. Let's say we would offer: int mt_rand ( $mode = MT_RAND_COMPAT ) int mt_rand ( int $min, int $max, $mode = MT_RAND_COMPAT ) MT_RAND_COMPAT = 1 MT_RAND_MT19937 = 2 A PHP user needs to make the right choice of what to use in their situation. A technical description of the modes would be confusing and unhelpful to most users. I have no idea how to document this simply, honestly and accurately, and without jumping to conclusions about suitability. This is why I think a compat/correct mode switch doesn't improve PHP. It's inconsistent with the spirit set out in the preamble of "PHP RFC: Your Title Here"[1]. [1] https://wiki.php.net/rfc/template Similarly, the $mode arg allows us to add MT_RAND_XOROSHIRO128_PLUS or whatever (interesting to some of us, more "modern", perhaps arguably more "strong" or are otherwise "better") aren't improvements to PHP unless users are asking for them. Tom