Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115163 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 41667 invoked from network); 27 Jun 2021 00:01:06 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Jun 2021 00:01:06 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 679B71804C3 for ; Sat, 26 Jun 2021 17:20:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 26 Jun 2021 17:20:28 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 14F365C00DC for ; Sat, 26 Jun 2021 20:20:28 -0400 (EDT) Received: from imap43 ([10.202.2.93]) by compute1.internal (MEProxy); Sat, 26 Jun 2021 20:20:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=vhj04Q LOFGwEkHYHVqILEp2zDwv0AzP7P5W4QMqbtek=; b=nORAuzwTgpd8kxNBir6m8A wVw8RcCyNTpsDRhtV/EXWjXN4dhTNiAFA/bnWr3sflwmvS5RaU5fDRj+HF59ZA/Q +QI3jkZwwQw70Eoe6KX90gbiGr95DqtgPAWYpWkZGvoUXRimnTIp+DUH1DLV0YYc cd4fimURcpbDFBbJIpzUnuduNCsiOgOuowToom/2OP6qmYsbovpjgq1NozMQt5ur pKO9buKZyHKnkCXxTaBA2bZJLghFLbDALaG2ez+ONAAaTLg52uWADfHzUSIk9qEC reOS5bEw2ZOvrTjlBDRnXvc0FnQg0nwakyygCkE7hh6Xg2E4ERFFfSdT5xetwq8w == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeehuddgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeefteevffetteeuueekgeejffduueehtdfhveefheei hfehgeehffehtdehgfeljeenucffohhmrghinhepphhhphdrnhgvthdpghhithhhuhgsrd gtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep lhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id DDD13AC0072; Sat, 26 Jun 2021 20:20:27 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-530-gd0c265785f-fm-20210616.002-gd0c26578 Mime-Version: 1.0 Message-ID: In-Reply-To: References: Date: Sat, 26 Jun 2021 19:20:06 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [RFC] Add Random Extension (before: Add Random class) From: larry@garfieldtech.com ("Larry Garfield") On Fri, Jun 25, 2021, at 7:39 PM, Go Kudo wrote: > Hello Internals. > > RFC has been reorganized for finalization. > > https://wiki.php.net/rfc/rng_extension > > The changes from the previous version are as follows: > > - Changed again to a class-based approach. The argument can be omitted, in > which case an instance of XorShift128Plus will be created automatically. > - Future scope was specified in the RFC and the functionality was separated > as a Random extension. > - Changed to separate it as a Random extension and use the appropriate > namespace. > - In order to extend the versatility of the final class, Random, a > RandomInterface has been added, similar in approach to the > DateTimeInterface. > > I've done a tidy implementation to make this final, but I'm currently > suffering from error detection by Valgrind for unknown reasons. > > Implementation is here: https://github.com/php/php-src/pull/7079 > > This can be reproduced with the following code. This looks a lot nicer! Question: Why `interface RandomInterface` but `interface RandomNumberGenerator`? I would expect either both to have an Interface suffix or neither to. (Preferably neither.) For that matter, I don't get why RandomInterface exists, if you'll just always use Random all the time, and it's final. --Larry Garfield