Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125214 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 2DD901A00BD for ; Sun, 25 Aug 2024 15:11:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1724598802; bh=G0iIXvr6nWUmW2ICWD1lKOX5G4eV3c32WAOYJfUu9SU=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=kCq+SECYRj65E5xbm3FjgKaUdZnMVCq4j3QjGWDvRUHOyuLP0a0wD0BU4/Ys0W4xB 9BDpAXxYmw+nGMD9KbSrz/3ZPKD53YiKAw5vngjHyESi+4nu5IOtcWmn+pt5dFgTjP CKKObIeI/PdzfTM6fllyKTQH2a7M9ARPzewj8Dtu7sNvPl/awp2tWYxf+vWJMYUj5m PrmljkdpA35hthDKGAdISPr59umRHQnnlBNgzIvB92/RAp+IRBuu388WnY8CJzKww1 3AMtsEDENeiXg3ztDKkbaXU+Kmf0WSNpK0z1EEEwxS28+c16Bb4Lgs7ZhP6hlyik9U 47TSfBFnSfwbA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3838E1801DB for ; Sun, 25 Aug 2024 15:13:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fhigh3-smtp.messagingengine.com (fhigh3-smtp.messagingengine.com [103.168.172.154]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 25 Aug 2024 15:13:20 +0000 (UTC) Received: from phl-compute-03.internal (phl-compute-03.nyi.internal [10.202.2.43]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 2E0D0114AB51; Sun, 25 Aug 2024 11:11:28 -0400 (EDT) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-03.internal (MEProxy); Sun, 25 Aug 2024 11:11:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1724598688; x= 1724685088; bh=yW72OqqvAd0yBpWwpP8wfZE4x9nBOfKSWy3uFFP6RpQ=; b=A s6w2jprpS3+9QxMtepcLpH681/Q37kYDl26MXbKmZmGnXBIaqwpDeSIAYG9jW74S WNBYflHWJ2O9pg6+bNa201kixdOAFVGHS212C1CVJyFi+cL9Sw5YGZ6xt0qGFuR/ JSxPSDRyJtfYcGU4s2xSDmcYIYvALv3AKN2jT2hplahF7SSBcC1ojXn+9IffFDI2 4gGGHKtZw4vQcnWJgCvgPiMBwy6TMKBQrU/+PIOwa2YEn7r8O1xGZmS2bKFYIsX5 lpi4VOa0uluYyS6KEMA20cYvYmXrREbQmoKf0dJwbwwPulfNBAZ1FdtgySi8omrR PIn8GR2MXQvkM9ubuDxVg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1724598688; x=1724685088; bh=yW72OqqvAd0yBpWwpP8wfZE4x9nB OfKSWy3uFFP6RpQ=; b=I6bEmX2t8gbb+mjOjqte5a20Z6VNuKOYJ6B2XLFy+3MR Xf/o7dRmlWzzD4pueLT1pweNE5fa8abRgZCVIg6aRfOsbaiQ4oXICFmU0r1vBQI+ UN2mXdG14NhYB7NkYI0OGxMDlV5t2XTo8KUu8X2lLc+pXbRqEyByDYpgpYLrObP/ JecauFdw0kkDJHXPCbf+XWLIhSne6/LBLg7ls5cXJvKZIc3mRp28jHUgXf0ciKaM pJLwe+dXd8fLn8QdM+c+goDWpVzj+OSOM0Yytf0rpPiuqtLMEjTn8al0o0xovq7z 2tGa5O9dimz0h6H0uZIU3b7n+azwmCA51XQWD6DgMw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddviedgkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepofggfffhvfevkfgjfhfutgesrgdtreerredtjeen ucfhrhhomhepfdftohgsucfnrghnuggvrhhsfdcuoehrohgssegsohhtthhlvggurdgtoh guvghsqeenucggtffrrghtthgvrhhnpeeiueethedvvdefjefhgfeiheelheehtdfhfeek jefflefgvedvkeduteejjedttdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehrohgssegsohhtthhlvggurdgtohguvghspdhnsggprhgtphht thhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehjohhhnhestghoghhgvg hshhgrlhhlrdhorhhgpdhrtghpthhtohepmhifvghivghrohhphhhinhhnvgihsehgmhgr ihhlrdgtohhmpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnh gvthdprhgtphhtthhopegsihhlghgvsehstghrihhpthhfuhhsihhonhdrtghomh X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id DAF59780065; Sun, 25 Aug 2024 11:11:27 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Sun, 25 Aug 2024 17:11:07 +0200 To: "John Coggeshall" , "Matthew Weier O'Phinney" Cc: Bilge , "PHP Developers Mailing List" Message-ID: In-Reply-To: <1DA8A427-85EA-449B-97AC-314958E8D49F@getmailspring.com> References: <1DA8A427-85EA-449B-97AC-314958E8D49F@getmailspring.com> Subject: Re: [PHP-DEV] [RFC] Default expression Content-Type: multipart/alternative; boundary=0a27b97ea03e4b29a6e6b903c26976e2 From: rob@bottled.codes ("Rob Landers") --0a27b97ea03e4b29a6e6b903c26976e2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sun, Aug 25, 2024, at 16:58, John Coggeshall wrote: >=20 >=20 >> If the underlying API changes the argument type, consumers will have = an issue regardless. For those cases where the expression is simply `def= ault`, you'd actually be protected from the API change, which is a net b= enefit already.=20 >>=20 >> This also protects the user from changes in the argument names.=20 >=20 > As I said, I don't have a particular problem with `default` as a keyw= ord to express "whatever the default value might be in the function decl= aration", but I do have some real concerns about its use as an operand i= n an expression. The RFC provides for a single valid use case of operato= rs (i.e. things like `default | JSON_PRETTY_PRINT` ), yet calls for a hu= ge array of valid operations, many of which the RFC itself notes don't = make much / any sense. I'd personally like to see this RFC dramatically = reduce the scope of operations supported with `default` as an operand i= nitially (e.g. perhaps only bitwise ops), and revisit additional operati= ons as needed down the road. IMO there is a very small subset of all PHP= operators that make any sense at all in this context, and even fewer th= at I think are a good idea to allow even if they might make some sort of= sense. Which operants don=E2=80=99t make sense? =E2=80=94 Rob --0a27b97ea03e4b29a6e6b903c26976e2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

=
On Sun, Aug 25, 2024, at 16:58, John Coggeshall wrote:


If the underlying API changes the argu= ment type, consumers will have an issue regardless. For those cases wher= e the expression is simply `default`, you'd actually be protected from t= he API change, which is a net benefit already. 

<= /div>
This also protects the user from changes in the argument names= . 

As I said, = I don't have a particular problem with default  as a k= eyword to express "whatever the default value might be in the function d= eclaration", but I do have some real concerns about its use as an operan= d in an expression. The RFC provides for a single valid use case of oper= ators (i.e. things like default | JSON_PRETTY_PRINT ),= yet calls for a huge array of valid operations,  many of which the= RFC itself notes don't make much / any sense. I'd personally like to se= e this RFC dramatically reduce the scope of operations supported with default  as an operand initially (e.g. perhaps only bitw= ise ops), and revisit additional operations as needed down the road. IMO= there is a very small subset of all PHP operators that make any sense a= t all in this context, and even fewer that I think are a good idea to al= low even if they might make some sort of sense.

Which operants don=E2=80=99t make sense?

=E2=80=94 Rob
--0a27b97ea03e4b29a6e6b903c26976e2--