Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118291 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 48854 invoked from network); 20 Jul 2022 16:54:45 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Jul 2022 16:54:45 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 47C94180380 for ; Wed, 20 Jul 2022 11:51:20 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS29838 64.147.123.0/24 X-Spam-Virus: No X-Envelope-From: Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (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 ; Wed, 20 Jul 2022 11:51:19 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 7240F320047A for ; Wed, 20 Jul 2022 14:51:18 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Wed, 20 Jul 2022 14:51:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1658343077; x= 1658429477; bh=600XCtzsjQ3Zc0H5F+QG9rb3CBIaYR6t8nN+HKsCJ2o=; b=A /vZcdPqQZ1uZ1ryDUaNeZyxN5DgffVuGk6wrl4sBVI1yoBEWd6Y/FSbqhvVWBsZD cBQFwjPxv1QsbAJLPLXivKUGdOVbB4czQNFyxaIFKZL1SVz+8ZyFGIrEyOcPMFym 6JP7hKPygp6ml5XvOvNpAO8Vq3wwpn/hQJ3K+CqtXkWCiK3NKvw+S5O6OJvkx2ZQ uJdzTXoYMacK6EP6GGZ6XNOV+LJnprxSUueet1Kyon7tFbtFiahCwFfb3Vdxu843 aFd2vjuljA9/iw6/8Y0abVqpe3z/57hAfBh0EKBMon+/oz2LszTYZ1aCWhJGHfWd 1uqJDwxqkm3LixzX16Rzw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1658343077; x=1658429477; bh=600XCtzsjQ3Zc0H5F+QG9rb3CBIa YR6t8nN+HKsCJ2o=; b=K3YfC6xTAR6lMzgB7LBDlq70lFPg1zTwfPTWEycZSsWw HLt2oEKXUEMYzlbw14HbeN/sKkc0uoSFWsmXdlM+9OS6iQyJykW+7HAVh8Fp9iqF rBcNFLnnNMNf2KE58e3n2CdMZaUuhFRdGbOzckuHwfqqobBpVG0o94mMZKU+ERvf 63CB+gwqqYgUfXcLzyBwmBM77e7V8tbw+yTZuUss6+G2cVczYdb3R86aZLHJ06Tz m63ujYbkFngDZO3hThiEMb6MFujo5ufxYpPEV7EitOGAq2Z9Ty3Evc+XC7qtkqFA J4h8K3CH9i2fcm1AOpbDhJ/42pt1WrF60mjJk9uDbw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudelvddgudeffecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuggftrfgrthhtvghrnhepfeeiheeuffethfegfefgkeeviedufeetjeeiueef leevleevledthfejheffveevnecuffhomhgrihhnpegvgihtvghrnhgrlhhsrdhiohdpgh hithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 55B91170007E; Wed, 20 Jul 2022 14:51:17 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-755-g3e1da8b93f-fm-20220708.002-g3e1da8b9 Mime-Version: 1.0 Message-ID: In-Reply-To: References: Date: Wed, 20 Jul 2022 13:50:57 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] Random Extension 5.x needs follow-up From: larry@garfieldtech.com ("Larry Garfield") On Wed, Jul 20, 2022, at 9:24 AM, Go Kudo wrote: > Hi Internals. > > The Random Extension 5.x and Random Extension Improvement RFCs have been > passed and recently merged into the master branch. However, the proposal is > still problematic and implementation fixes are needed. > > Currently, the mt_rand() function is overloading its arguments, and I have > designed a Randomizer::getInt() signature based on this. However, argument > overloading has several problems, including reflection, and is now not > recommended. > > I wish I had been aware of it during the RFC proposal, but that did not > happen. > > To solve the problem, I thought of separating the argumentless > `Randomizer::getInt()` as `Randomizer::nextInt()`. `Randomizer::getInt()` > must require `int $min, int $max` arguments. > > I have received support for this proposal from several people, but there > will be a discrepancy between the RFC and the implementation. > > I believe this should be corrected to avoid future BC Break, what do you > think about this? > > Discussions: > - https://externals.io/message/118163#118269 > - https://github.com/php/php-src/pull/8094/files#r919693108 (just scroll a > little please) > > Fix PR: https://github.com/php/php-src/pull/9057 > > Best Regards > Go Kudo This is ultimately for the branch maintainers to decide. I would personally favor fixing the signature now, even post-freeze; the whole point of betas is to find problems and edge cases while they're still semi-fixable, and this sounds like one. Splitting it into getInt(int $min, int $max) and nextInt() would also be acceptable for me; if the branch maintainers are OK with it, I would favor that as methods doing double-duty is just all around bad news. If not, handling it like touch() is the next-best option. --Larry Garfield