Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118918 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 62212 invoked from network); 30 Oct 2022 12:45:07 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Oct 2022 12:45:07 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 11BF21804AA for ; Sun, 30 Oct 2022 05:45:07 -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_H2,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-vs1-f52.google.com (mail-vs1-f52.google.com [209.85.217.52]) (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 ; Sun, 30 Oct 2022 05:45:06 -0700 (PDT) Received: by mail-vs1-f52.google.com with SMTP id 128so8959521vsz.12 for ; Sun, 30 Oct 2022 05:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=7ehIgp+Wsfy6qx9DuZ4gmYYa7kNzJtwfGKf7qinbSmY=; b=fJTQeuBhkOClErS7hJfvmKeeB9Zh9dcy5VuZp9buipOmkZ62m97rAk0WDVFhpQyCnW tiAAMZh7OsW0fqUfd53UWwDygrFWQmb0i8gb5JKB+6y4azsyc34kz+Rez0F3fpBFMeT2 wETNy3He38NcRRQAsmHX3esBgI+aHPEWquKwOVYWsfxOVTndQL8D8+uEQPhnRkK96cEL 74UUmmW0w9ISdbN5TFPYfd8fUzlf2qEJW3q3AA8OKhs0tbPVEMfTcdCyHZZ+2wbtZQX2 84CNI7xeSZUNAv4Ew6RDArgI9eYGlF325tYo1RLOw4b63kidwx+/+Vk5/q5wM5SclyfD 4ghg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=7ehIgp+Wsfy6qx9DuZ4gmYYa7kNzJtwfGKf7qinbSmY=; b=ZJOJ+z1IrPj7lz1rTdXIQRFDrdxsCXOFjuA58OB6tNaF20FJ3FALO5jTj5LjikbCZ1 TdGtDIr522M1Y72qfYbvIYwb4cS6fR1LgrSFm+pW0lvPOFjZUpc2KQrsPNx6LErIF2Z8 lkpI/xH+11ckngxdXZrcdln94NQyUNMewAavCswc+0rUTJ2woJ/P6D6v0VSE8YNCMysE Fw3s4U8TVizKvXBQS1sT5kRe2J2gj9vsjogsu0Z0TtYk3fgUzX870zF1E3ghmNoNBVgu W6Ecd7BdZEERM3bs7mCoPUtxVWGKzeiTKjQ5ZFVVEf1B/LLJrR158a/xHih4bz69ni6e bR7w== X-Gm-Message-State: ACrzQf2tPqqokXpN5n2rwi0Y+3DQL1W27ROefJa9aj/cqBMxWwqs9KBg YoY5aJO/uAJ3NWbtANAk4Q/5N9lL5qyQPQrpKwIQlTbPxEQ= X-Google-Smtp-Source: AMsMyM5m8oUNn7W/0V0cwT/QOJN9Mqfh3njmUEk1aZPf34WK6Ruk7Vc4xWNIAqgStJopuzmCCCbThvElZhmnunxOWhQ= X-Received: by 2002:a05:6102:2327:b0:3ac:876f:c26c with SMTP id b7-20020a056102232700b003ac876fc26cmr946822vsa.73.1667133905404; Sun, 30 Oct 2022 05:45:05 -0700 (PDT) MIME-Version: 1.0 References: <5ceebae4-a3fb-5d29-cdb7-dceed7b07c78@wcflabs.de> In-Reply-To: Date: Sun, 30 Oct 2022 21:44:53 +0900 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000398a4105ec3fdc0b" Subject: Re: [PHP-DEV] RFC [Discussion]: Randomizer Additions From: zeriyoshi@gmail.com (Go Kudo) --000000000000398a4105ec3fdc0b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2022=E5=B9=B410=E6=9C=8814=E6=97=A5(=E9=87=91) 13:33 Alexandru P=C4=83tr=C4= =83nescu : > 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 so= lve > > 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 dictionar= y > 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)? An= d > > 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 migh= t > 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 metho= ds > in PHP 8.2? What can it break? > > As the Randomizer class is final, I guess this will not be perfectly polyfillable in userland. What case do you envision for this? Probably, most cases can be polyfilled by code: https://3v4l.org/JludD And it seems that someone has already done such an implementation (which is very nice and I would like to express my utmost appreciation). https://github.com/arokettu/php-random-polyfill Regards Go Kudo --000000000000398a4105ec3fdc0b--