Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120431 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 47448 invoked from network); 29 May 2023 15:51:30 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 May 2023 15:51:30 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 992FC1804D7 for ; Mon, 29 May 2023 08:51:27 -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-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (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 ; Mon, 29 May 2023 08:51:24 -0700 (PDT) Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2af1822b710so35769331fa.1 for ; Mon, 29 May 2023 08:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685375482; x=1687967482; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=kfogfti5g+pTjLO1ZFVTqAiKjxlcarJ2Iie+5D+GJeI=; b=a7bCMleYKbpi3RqL7mMC7LrlfTQbImCp61vYPOrMB4rVJs14wgQQ9suK3N48URoHoq XciaTaD+gWju2VFkCY+Z0TrP/qZYo2VCnSxkBKV/OwkCQCiOITnrLKOOj2IedSD43p95 VnWm46GsuOT49AZWV+VLcpa6RDmTg1ID/3h0guA+BaEBFSWb6UbXois4qY+HKYR4crqQ Zc5XN12iUmq7e+I70fjk7znUsVQe03+aJXNTJJ3pduVb9z9SrufNPd68K/ykZtVf5nJZ NI1+WE6hRNcTABTA5oUikcdQSJEmZzARORLAizJTwJJ68obYAxTIcYOfkNj5k5tO5Huh q3ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685375482; x=1687967482; 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=kfogfti5g+pTjLO1ZFVTqAiKjxlcarJ2Iie+5D+GJeI=; b=U+rfDdrHSA/tDyuKQ+cEDSRhfKI5ohWMbvVXaHgMJuqUP7SGaulCsTH8gCEg3/TcFg /B/2OTftf20ZJMGb7aiOigNvoDIXvpCkBAPRPIEX/be7rGfGJACb4i8wNd/Nl+EQar8p IP6u4HUWPWc0yXvDjH4DPxtmdOVQN29ZlXQ0Qoa+GYbuG6dFB9TBZjeF19pkGvFvv5x2 OXe0FHE0Qji0erGq+typtk2Y0/V1iINS+NXqo3oXHPs5kJyEOWcNHOfon2X58HcQbPTs 2KZD8Ff1/p/QTuvFEsAe6HMqqlBFn+V753lxOxsfN9P68lp/6v2+N3yQ50Qjqw5ZoFWX aJ3g== X-Gm-Message-State: AC+VfDy6t6GewZuL3uy/WTfFtOga/umo4yzOTf2WYbWUoh2STA/bB3Ud 80lGmONdGb9M7XuHKyoD3pqr8Z1dRvarpDIJAYu65wmJMEA= X-Google-Smtp-Source: ACHHUZ6o1b/LME1NNmd86F9C/Gl2wjlenYpJ1VP5qNa+cj+4nKR4sjIeVxiRJnp0gkFEE6RKe6i8NHHF8hwKHKq2DDA= X-Received: by 2002:a2e:a0d3:0:b0:2af:1844:6fdb with SMTP id f19-20020a2ea0d3000000b002af18446fdbmr3917878ljm.5.1685375481972; Mon, 29 May 2023 08:51:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 30 May 2023 00:51:10 +0900 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000ea8be105fcd70ee6" Subject: Re: [PHP-DEV] [RFC] [Discussion] PHP 8.3 deprecations From: zeriyoshi@gmail.com (Go Kudo) --000000000000ea8be105fcd70ee6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2023=E5=B9=B45=E6=9C=8830=E6=97=A5(=E7=81=AB) 0:42 Nikita Popov : > On Mon, May 29, 2023, at 08:05, M=C3=A1t=C3=A9 Kocsis wrote: > > Hi Everyone, > > > > Together with multiple authors, we'd like to start the discussion of th= e > > usual > > deprecation RFC for the subsequent PHP version. You can find the link > below: > > https://wiki.php.net/rfc/deprecations_php_8_3 > > > > Regards: > > M=C3=A1t=C3=A9 Kocsis > > I don't think we should deprecate mt_rand(). > > There are plenty of use-cases that require neither a seedable > (predictable) RNG sequence, nor a cryptographically-secure RNG. For those > use-cases (and especially one-off uses), mt_rand() is perfect, and going > through Randomizer is an entirely unnecessary complication. > > I think I could get on board with deprecating srand/mt_srand to make > rand/mt_rand non-seedable, directing people who need a seedable RNG to us= e > Randomizer, which is much better suited to that use-case. However, we > should retain rand/mt_rand themselves for non-seeded use-cases. > > With srand/mt_srand removed, we also would not have to produce any > particular sequence, and would be free to switch the internal RNG to > something other than Mt19937. > > The same extends to array_rand(), shuffle() and str_shuffle() -- in fact > the RFC is missing an important voting option, which is "leave them alone= ", > or rather "convert to some non-seedable non-CSPRNG" if you prefer. > > Regards, > Nikita +1 I too feel that the `Randomizer` is overkill for many applications. However, I believe that there is a suitable alternative to `mt_rand()` / `rand()` : `random_int()` It probably makes the most sense to use it. On the other hand, there is no suitable alternative for `lcg_value()`. The simpler `Randomizer::getFloat()` would be fine, but on the other hand, floating-point random numbers are very hard to handle, so some say that the `Randomizer` class should be used. I would like to hear your opinion on this. Best Regards, Go Kudo --000000000000ea8be105fcd70ee6--