Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118812 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 99883 invoked from network); 14 Oct 2022 04:32:53 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Oct 2022 04:32:53 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CE754180054 for ; Thu, 13 Oct 2022 21:32:52 -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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 13 Oct 2022 21:32:49 -0700 (PDT) Received: by mail-pg1-f177.google.com with SMTP id q1so3313505pgl.11 for ; Thu, 13 Oct 2022 21:32:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GqO2YBMVP7RIv4sYMcLUw/mxEsbykNqA+qqixTuc8pU=; b=mBek61njwyBs+tUfkGHMnmd08sLVcqeigNqQcdz9CqipBuyXKrnEa0i0ViL2TyR5fz L/JiXzPZ55R9pYGYl+q+HxOJhcdZqttP95+eWCScLgxXlkpLaMWhgCrlstWzoqt6rCHX 34Q//2nOdHbigkyLcNBauYutgvyyuaHrUdCHIfhLaMe0OB9iGYyWJwcy3Vl0tP+P19CZ LWzRWau6aTmTJT4LcBlSc12uRuAEhlx35mB3MaLeS44dusiPmEtK8n3iGGeGRBFFsms/ BIvqN7LBTSZsXqwKhHaaUbxXKiCOzRmdJv2eX0D/MJ8j4BfJlE1WqLPKf5bg4JwRggVG yFwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GqO2YBMVP7RIv4sYMcLUw/mxEsbykNqA+qqixTuc8pU=; b=u487w3FzdzRkcUuZ4gv54q85NQDHTSBrML6O0MyfGignE8ovC7I0ksTQY5ADIXvioe 1SoDeuWmNErbAsBvrGYfN/ImC7vkEyauTXNQHQFdOzyd+8apNlvo7CY+TfaytnNSGSf4 M2qa1+fjPWPYjSi0j4gbW6uH89GqjvW7L7KuY8gUtq6GY04AfxuDB5v5amOEGPP2EDhv 69U81p9NsMCHuZ8WEYXXziTHTmDAI3xdPNeEg9QQ6TOP6jyX5uXjkvw1qIP/Oy05fOIT dDujwxLchzEI2VpY73gVbCUwnXeH+2c4fR0ke6nrhG5aS8kk4fxIjiE4oF2blUTp+02Z LQbg== X-Gm-Message-State: ACrzQf1bwa4TWmXeaE9/ob+FaP2pKQ32ldZVNI45Sun1wE6q2XxCNSQ0 Gi5AZUGaZ6t+auHt7fXfZrVs/WjQ1fxnW4FFtgam3oNzwDU= X-Google-Smtp-Source: AMsMyM4H7N25I9aidY90cja7yxP8Z95BRehxl7MWp0Jw0DtY31TRrTqK4Qf14bK0vZprEU5Dikk60OYi428xvvRXX8o= X-Received: by 2002:a63:1e10:0:b0:439:3c93:25ab with SMTP id e16-20020a631e10000000b004393c9325abmr2981791pge.317.1665721967769; Thu, 13 Oct 2022 21:32:47 -0700 (PDT) MIME-Version: 1.0 References: <5ceebae4-a3fb-5d29-cdb7-dceed7b07c78@wcflabs.de> In-Reply-To: <5ceebae4-a3fb-5d29-cdb7-dceed7b07c78@wcflabs.de> Date: Fri, 14 Oct 2022 07:32:34 +0300 Message-ID: To: =?UTF-8?Q?Joshua_R=C3=BCsweg?= Cc: PHP internals , tim@bastelstu.be Content-Type: multipart/alternative; boundary="0000000000002efcea05eaf71e14" Subject: Re: [PHP-DEV] RFC [Discussion]: Randomizer Additions From: drealecs@gmail.com (=?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?=) --0000000000002efcea05eaf71e14 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Oct 13, 2022, 22:37 Joshua R=C3=BCsweg via internals < internals@lists.php.net> wrote: > Hi > > Tim D=C3=BCsterhus and I have created an RFC to add new methods that solv= e > commonly encountered use cases to \Random\Randomizer. Specifically > creating a random string consisting of specific bytes and generating > random floating point values. > > You can find the RFC at: > > https://wiki.php.net/rfc/randomizer_additions > > Proof of concept implementation is in: > > * https://github.com/php/php-src/pull/9664 > * https://github.com/php/php-src/pull/9679 > > > > Some open questions to start the discussion: > > * Are you missing other commonly useful operations that are also useful > to have in core? > For completeness, it would be good to have nextBool() as well. * Do you agree with the method names? Within the PR we received comments > that "alphabet" might not be an appropriate term. > Yes, alphabet is fine by me but I can suggest also: character set, character list, character dictionary, byte set, byte list, byte dictionary or some shortcuts of it, like charset. * Shall an option be added to getFloat() that changes the logic to > select from [$min, $max] (i.e. allowing the maximum to be returned)? And > how should that look like? Boolean parameter? Enum? > No, IMO. Mathematically it doesn't really make sense and talking about floats, it will also be a very corner case not reached in tests that might happen in production rarely and break things. > ---- > > We're looking forward to your feedback. > > > Cheers > > Joshua R=C3=BCsweg > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > > I am having another small issue. As the Randomizer class is final, I guess this will not be perfectly polyfillable in userland. So... , if accepted, would it be completely wrong to have these new methods in PHP 8.2? What can it break? --0000000000002efcea05eaf71e14--