Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125194 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 0714B1A00BD for ; Sat, 24 Aug 2024 21:15:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1724534227; bh=0uHYR3faUDJ7bjFf6asOzbP9SEBOVogeaMv1OQnRmLU=; h=Date:From:To:In-Reply-To:References:Subject:From; b=ktDaH2BNT7MZoX7QENyw0oHvn5jTtz6VQ+YYhDT3S182FteKEzuwuudLlsjqjeJc1 j/uuvDviKcKHjPuON6wq64E5lew7CC8AtW9m9ZTfp2T+aZE5R73YrtWzQkbALe3CHt 3ghggz9iUysvr6gNBR+RkzkL+YHcCoSq6tbkqPUgHcLIlUilNJgmcP2ZsB3VSLCn2b BWppaSwr/1X7QqZdeWW9g70l5n251p3i8d4JWf40VDCkKgiz4hA0SbTZaKXhid1V1U DFc0zHofJcdQNzbd5UwCEczpoqWwlNcdCfp6G4zpTe83WFqNAnUYwLGesCCNeYkIo4 ZU9aOT7Auq3cA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E7A9018003E for ; Sat, 24 Aug 2024 21:17:05 +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 fhigh8-smtp.messagingengine.com (fhigh8-smtp.messagingengine.com [103.168.172.159]) (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 ; Sat, 24 Aug 2024 21:17:05 +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 3DBD91152CFB for ; Sat, 24 Aug 2024 17:15:13 -0400 (EDT) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-03.internal (MEProxy); Sat, 24 Aug 2024 17:15:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=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=1724534113; x=1724620513; bh=0uHYR3faUD J7bjFf6asOzbP9SEBOVogeaMv1OQnRmLU=; b=fqi80r7GZQwF6fGhd7C+PyVt38 hsg64gEEsQCEiAgUj55KlipXrIDm9cpXx7VQYMwo4U4sBfcq2DYGfX77U0pvwwLn a9y7QbuptJYLoe8Kb+z95MwSqAXDDNfISzDDVdfKnJFX8XyT7g7y3C6Kr4XJ3MyN jT1GzHKEdE5GuyRQISJHYrkR8XKs9OWfmlD0vZWiNjIQHyfOPwn+x8kXwPNRIlBf Fl1pfnD9p5nx2qqz+U4Tmcl5B6d9jzC5fZu8EjPCh6GugRLuE+bMPPCIAYFWBtmO GjxfFI2DpWiwlzOMpvsiPtuLbAwCIyHskpnq1ya0FYLiY6TQrfRlXaW7khAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=1724534113; x=1724620513; bh=0uHYR3faUDJ7bjFf6asOzbP9SEBO VogeaMv1OQnRmLU=; b=C9EhESGjEEzT9/b7t0MNm1qu99U0JiJKDXcRW3pYWK1/ zqGsve6pbLvsQC4gF1L++wSh6p+mtfwrOaE3V0m1b5G5RXeHQfkrTcLoEltA7wJj wQLWIXbCpFyArpqeXWVUMoUcV6f4pAXNphpwXiZQuJ7L/1EBZTE5OIaxw2GmcBuv KIHAF53Fa0ZwBsbxgxF2k9vOyFiJ9ieb4WaJw4oO9Zp5DqIPh04N2SQPWOnXGm7C yAlOI1cR03GheBppCeLkUYibxipyqHxRsud3qXSbf5xg7BHD7u2AWF93ZiYlfYY1 mSoImhxphRSniuRlaEFWa9wBI4cIPs2J2KLVbdnwYg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddvgedgudehlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepofggff fhvffkjghfufgtsegrtderreertdejnecuhfhrohhmpedftfhosgcunfgrnhguvghrshdf uceorhhosgessghothhtlhgvugdrtghouggvsheqnecuggftrfgrthhtvghrnhepleekhe dtgfefhfelieelgfegiefhkedvleefjedtffelhfehheffgfduteduuddtnecuffhomhgr ihhnpehphhhprdhnvghtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomheprhhosgessghothhtlhgvugdrtghouggvshdpnhgspghrtghpthhtohep uddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhish htshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id ECFF2780065; Sat, 24 Aug 2024 17:15:12 -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: Sat, 24 Aug 2024 23:14:52 +0200 To: internals@lists.php.net Message-ID: In-Reply-To: <0c8ed5d6-5507-4c41-8d7f-05d14ba8aa4c@scriptfusion.com> References: <0c8ed5d6-5507-4c41-8d7f-05d14ba8aa4c@scriptfusion.com> Subject: Re: [PHP-DEV] [RFC] Default expression Content-Type: multipart/alternative; boundary=6626467ecee945ca99af7a1fd62e2931 From: rob@bottled.codes ("Rob Landers") --6626467ecee945ca99af7a1fd62e2931 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sat, Aug 24, 2024, at 18:49, Bilge wrote: > Hi gang, >=20 > New RFC just dropped: https://wiki.php.net/rfc/default_expression. I=20 > think some of you might enjoy this one. Hit me with any feedback. >=20 > This one already comes complete with working implementation that I've=20 > been cooking for a little while. Considering I don't know C or PHP=20 > internals, one might think implementing this feature would be=20 > prohibitively difficult, but considering the amount of help and guidan= ce=20 > I received from Ilija, Bob and others, it would be truer to say it wou= ld=20 > have been more difficult to fail! Huge thanks to them. >=20 > Cheers, > Bilge >=20 This is pretty awesome! I see this as some syntax sugar, to be honest: > as soon as two or more nullable arguments are involved I'm not sure what you mean here. I use this method all the time :) much = to the chagrin of some of my coworkers. function stuff($foo =3D 'bar', $baz =3D 'world'); stuff(...[ ...($foo ? ['foo' =3D> $foo] : []), ...($baz ? ['baz' =3D> $b= az] : [])]); Having this would be a lot less verbose. =E2=80=94 Rob --6626467ecee945ca99af7a1fd62e2931 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
On Sat, Aug 24,= 2024, at 18:49, Bilge wrote:
Hi gang,

New RFC just dr= opped: http= s://wiki.php.net/rfc/default_expression. I 
think= some of you might enjoy this one. Hit me with any feedback.

This one already comes complete with working implement= ation that I've 
been cooking for a little while. Con= sidering I don't know C or PHP 
internals, one might = think implementing this feature would be 
prohibitive= ly difficult, but considering the amount of help and guidance 
<= /div>
I received from Ilija, Bob and others, it would be truer = to say it would 
have been more difficult to fail! Hu= ge thanks to them.

Cheers,
Bi= lge


This is pre= tty awesome! I see this as some syntax sugar, to be honest:

as soon as two or more nullab= le arguments are involved

I'm = not sure what you mean here. I use this method all the time :) much to t= he chagrin of some of my coworkers.

functio= n stuff($foo =3D 'bar', $baz =3D 'world');

= stuff(...[ ...($foo ? ['foo' =3D> $foo] : []), ...($baz ? ['baz' =3D&= gt; $baz] : [])]);

Having this would be a l= ot less verbose.

=E2=80=94 = Rob
--6626467ecee945ca99af7a1fd62e2931--