Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95324 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53328 invoked from network); 19 Aug 2016 18:41:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Aug 2016 18:41:30 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.193 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.161.193 mail-yw0-f193.google.com Received: from [209.85.161.193] ([209.85.161.193:34571] helo=mail-yw0-f193.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0E/55-17996-9D257B75 for ; Fri, 19 Aug 2016 14:41:29 -0400 Received: by mail-yw0-f193.google.com with SMTP id j12so1141800ywb.1 for ; Fri, 19 Aug 2016 11:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ZvlYiEx9EGyn7uV8wtZVBnhvtyM82YmbEeJbJK0+2Dw=; b=cALA2hd8O2SFvOVsgSmCxAHYZf/D5a97GMKqrl5wz/MpPKyyEHuXDq2YVjtRHEOKAg 19U9OHoHrL5w5I4SzUvOna/zarki3qldsfEPt2jenPaIBrHFzKppFd3B9boGJAS1eb/+ nbaqjLPAcy1F5ZarOQ/KPIQvKvumLJJ826pizbfjB0NoGoDO5ipgaXndUDQY+WKoX4A/ hJTEeN5kis7nTVHEIIcR0VAnAsYNvSwKQDliNbLaCtLinw233ILxkqYoGBMF1RkEl5oU 8xPFGIKxVSr7sovvFKrINlSGkdw5XgJxRW0Q7KKsOZwS3dsaxPbkzI3DG1C7ODIhTmqO j5IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ZvlYiEx9EGyn7uV8wtZVBnhvtyM82YmbEeJbJK0+2Dw=; b=lGoZUj3PUfFqc41ht1kgZSe+4fhRBNrLX1TdFPUWoPvkAoE9GKJXY99w/A+/PpB6cs L/v0WWacHKZycV/ccH4zQ0t9w1NCSdwsNFKdL9R64tCG4v3b7kvZ4/eTtTWlVNGx4LEB idJs6mclttqcJU79DtQVG5EtOKtweFUwR3I4QTl+xv/mLR0Zw1h0Pwgdfu37I2u6r0Ei U8ahcKf+98MDxyCEeJ6q5lVRxjyL+M0NYDxF2rVmxQQwiGF/MYNrcnF+QDmvIXm5WlfY Dv2nS11ZdY/6heCdVNSUabSV1xgL+RIhIJio4eHGZtibcNZkRMqytq2DI9uOGmp4MsPx JtwA== X-Gm-Message-State: AEkoouuHuyOqHMBZMA4YSR6xg+7/YN5Jy0YAjFu11JSJYYRcZJI2J5LDKa3ln8nsn+W41wec8lDeNsVEz7Murw== X-Received: by 10.13.221.198 with SMTP id g189mr7681792ywe.93.1471632087193; Fri, 19 Aug 2016 11:41:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.131.129 with HTTP; Fri, 19 Aug 2016 11:41:26 -0700 (PDT) In-Reply-To: <37f541c321ec5cae15d8ca0a1f9c0716@k-piste.dy.fi> References: <3d8be1faf8d4d3e5add3768d7a8eb16c@k-piste.dy.fi> <20160814211942.16358-1-lauri.kentta@gmail.com> <37f541c321ec5cae15d8ca0a1f9c0716@k-piste.dy.fi> Date: Fri, 19 Aug 2016 20:41:26 +0200 Message-ID: To: =?UTF-8?Q?Lauri_Kentt=C3=A4?= Cc: PHP internals , Tom Worster Content-Type: multipart/alternative; boundary=94eb2c0779cecc231e053a710be6 Subject: Re: [PHP-DEV] Re: [RFC: PATCH v1] Implement mt_srand_array From: nikita.ppv@gmail.com (Nikita Popov) --94eb2c0779cecc231e053a710be6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Aug 19, 2016 at 8:20 PM, Lauri Kentt=C3=A4 wrote: > On 2016-08-15 18:53, Tom Worster wrote: > >> Hi Lauri, >> >> Do you have a PR against php-src on github? It's easier to read and >> comment. >> >> Tom >> > > > Here's a PR with a revised patch (also accepts other than pure integers): > > https://github.com/php/php-src/pull/2089 > > > And here's an alternative with no sanity checks at all, which makes the > patch even simpler (and more PHP-like, since 'foo' is silently converted = to > zero; this truly the most marvelous feature of PHP). > > https://github.com/Metabolix/php-src/tree/mt_srand_array-v3 > Personally I'm not a fan of this. We should not perpetuate the use of mt_rand() as either a seedable random number generator or an implementation of a specific algorithm. We have broken the former in 7.1 (seed sequence change) and were close to breaking the latter (replacing mt19937 with xorshift128+). Instead, let's first introduce an object-based PRNG interface, which a) does not rely on volatile global state and b) is explicit about the choice of algorithm and seeding procedure. Thanks, Nikita --94eb2c0779cecc231e053a710be6--