Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129937 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 lists.php.net (Postfix) with ESMTPS id 8E6F91A00BC for ; Tue, 27 Jan 2026 08:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1769503230; bh=AMJIFHsW7/sHrm1J/707wyCKoucVCwId2dYpXeWqyB0=; h=Date:From:To:Subject:In-Reply-To:References:From; b=MmZyQgxWNkkE+81obWsRbtdHXVB4qEn+KSf9leI0+i5hJ6dnasuIuKeZvNo9/CbHZ TwSpiGa00IQzLaMGXN4m5CVFS186ElHgDiQ+ogzUVTgT3mevPRU8pcqWx0Ahu+bgeF mLZsQB/VhvQ1A00vqXbFcKniH5IU7xkuWNw0APplUti3q191eSkHSmtnveKyMSCVco 0zh8x881+KPV4ojzabfC7yRbaGXJehoqKV7CBdtokmEQYxI+WLUf2XDIr5xhTOiXG8 j/cHQguKB6ztK5hPa5VCYVNS6rE9V7nmz4ZPcii0q2C03E+clVZW660BG5OfhxyL3p Ovrl/W8rr0hiA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1B5A1180072 for ; Tue, 27 Jan 2026 08:40:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) 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,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fout-b2-smtp.messagingengine.com (fout-b2-smtp.messagingengine.com [202.12.124.145]) (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 ; Tue, 27 Jan 2026 08:40:26 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfout.stl.internal (Postfix) with ESMTP id 7E1181D003B6 for ; Tue, 27 Jan 2026 03:40:20 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Tue, 27 Jan 2026 03:40:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding: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=1769503220; x=1769589620; bh=km7DA8q9Ek56ZpL7w+wM2G0CjZImdqP7dwsh1FHzQZo=; b= pQPepe9PZJBYklPMC6QJzhG+btTzD1juqL3CHWI3DDiMaopOwkuI5eBPB6ox5uz0 3ubs0vkIuuUT0CeWaCwDLl/HAADJxbFoPvvnhCedwL1n1WX3Y4WEbMrItJPB/jNo xS5yr8uEFXfEtQGsd1z4yQaOb9F0YC2r52cUD8cqQe1Pth+Nii+Z4RTgLaPUiC9p WRRW4EYS/Gr0EJCnn8AIl2n0DRoazozYvfB9uBOvkGwQHpiKMg9r2EnWc1hzcAq7 MWa4l+edmPDNXDywR/hSzZET0P6ZthEEL5VSfj5Xp9H871YK7PBwJR6UduEw+VT8 VH8ZErXDOOX2AQI5Qekowg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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-sender :x-me-sender:x-sasl-enc; s=fm2; t=1769503220; x=1769589620; bh=k m7DA8q9Ek56ZpL7w+wM2G0CjZImdqP7dwsh1FHzQZo=; b=NsEOUuE55MK+He9pk g3jNbCtKFW8j2/ZoTF8nTD3K/xaYN7WvKvIHosXYgars7yPsOD3fY22o5vhAjQRu P6WHneK2OeOcQINmtQbyFeWhMfrGUsPS2tr48ZBgEcSAg9ulGT4sa17NauIbcl2F XAoVRTauo9m9/jLWuRlcpnFTKbahRPCV/L/JBBotFl+OdtIaN+vS+Rn2+dFlZKdh j6F+Ml5LZ2ZzksFdjr1i41uJzVNNqpWW2gKgo0p1I6W9S7BqjZHVT9MZF+PtJdni b7qqijzVU/w7vN/d6nor47cFQZ1X6OhRjdduuvIgK5G0RBpCCfCJOMRpwG+t4UcR uqttA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduiedttdekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvffufggjfhfkgggtgfesthhqmhdttderjeenucfhrhhomhepfdftohifrghn ucfvohhmmhhinhhsucglkffoufhorfgnfdcuoehimhhsohhprdhphhhpsehrfigvtgdrtg hordhukheqnecuggftrfgrthhtvghrnhepheelffetiefgveduteefudegtdduveeludeg ueegleehiefhhefgtdekveevgfelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepihhmshhophdrphhhphesrhifvggtrdgtohdruhhkpdhnsggp rhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehinhhtvghrnh grlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 27 Jan 2026 03:40:19 -0500 (EST) Date: Tue, 27 Jan 2026 08:40:17 +0000 To: php internals Subject: Re: [PHP-DEV] [RFC] Pattern Matching User-Agent: K-9 Mail for Android In-Reply-To: <56dce794-a512-421a-a8d2-91a9692c1ab4@app.fastmail.com> References: <56dce794-a512-421a-a8d2-91a9692c1ab4@app.fastmail.com> Message-ID: Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 23 January 2026 19:48:31 GMT, Larry Garfield = wrote: > >4=2E The variable pinning syntax=2E There's been some concerns about it = being non-obvious, which is valid=2E The main argument for it is "it's wha= t Ruby does", which is not the most compelling argument, but it's not inval= id=2E As I think I've said before, for the average PHP user, the question isn't = going to be "what's the syntax for variable pinning?", it's going to be "ho= w do I tell if this variable is input to or output from the pattern?" In ot= her words, variable binding and variable pinning syntaxes need to be design= ed as a pair=2E=20 Take this example from the RFC: if ($p is Point(z: $z, x: 3, y: $y)) To a PHP programmer who has never seen pattern matching before, that looks= like it's testing three properties, not doing some destructuring assignmen= ts=2E If variable pinning isn't supported, they'll soon learn; but if both = interpretations are supported with subtly different syntax, I can see it be= coming a major source of bugs=2E Maybe that's why a lot of languages don't = support pinning at all?=20 The only way I can think to make this less painful is to have some pair of= syntaxes that signals "in" and "out", or "read" and "set", in some way=2E = For example, this looks rather ugly, and may not even be parseable, but it = signals the behaviour fairly well without having to read the manual: if ($p is Point(z: $z=3D, x: 3, y: $y=3D)) if ($p is Point(z: =3D=3D$z, x: 3, y: =3D=3D$y)) if ($p is Point(z: =3D=3D$z, x: 3, y: $y=3D)) Regards, Rowan Tommins [IMSoP]