Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129502 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 348B61A00BC for ; Tue, 2 Dec 2025 06:51:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1764658319; bh=3N9eDzXoRgFrn4n3ZEallpoq1W2MzXjdL64qNBWN0tg=; h=Date:From:To:In-Reply-To:References:Subject:From; b=U+/qwRzs4b6GHRvg24Mu9pGqQKOt5JmqCghEfYm6TKy4Md57G1d/sAI6MSgBuR4E5 DayRrd72AKg0cwFKhM0T4T1EkdHN5Tr8hMXi+2hUH3tZJJR6X9KgeVwiCEQFdJbRyC 1izEgvSdmVXVzOsx/Ez3RBiSyXDpXIkK38t584qcsNENK0SeN14e4299yqUTTP7sVF dM4LE7OHrTouM9aLIWOMLlLq8k4Q8Yo0cVRQRV4zMGWZcoRWZ48/gpv9ImStMV1ZXA El0UYyvncdLdvXACyPLZRetW0OKiVQdMBpKJo/PcLzvZ1tuPW1AaNtwmKomYYr9D8O kgNWMJNKMOMFQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 20FDA180077 for ; Tue, 2 Dec 2025 06:51:57 +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,HTML_MESSAGE, 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 fhigh-a5-smtp.messagingengine.com (fhigh-a5-smtp.messagingengine.com [103.168.172.156]) (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, 2 Dec 2025 06:51:54 +0000 (UTC) Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfhigh.phl.internal (Postfix) with ESMTP id 7AE4F1400226 for ; Tue, 2 Dec 2025 01:51:49 -0500 (EST) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-12.internal (MEProxy); Tue, 02 Dec 2025 01:51:49 -0500 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=1764658309; x=1764744709; bh=jOk9hkJ6/T KZGgaULgat3Eo1PPKWysPo3Q64E+yBD28=; b=L7xWLdQbfj0ksITAOu+iVtvOC2 W1i+6a3EG5m5NSUDC9ZKRzCymk79BsMFOU+2PTLZgBvkAfnr6q7fvIBvPxCMKddL Awt+uoUpmR3jUhMrOH7U6YwYSE3drBgkPeEfxkqn4HvxkwaSE+rtKMBEKTEAxEg0 Tfc6UOrto1cCycaIud+dzG6+zlcm1CC3vIoefSOROcV1h0mJCOK9z45PreJPWEbO 98adi9cKpulfRLTtZoravzSAD1aU7Pv7G7TyllDLSNC9y0hxyKN63o/QwwnkpgzP 724CapHLmG9t94BofcZo2HkIH/+HScMOXRFUsOyVzTINZjiRfiH3neZHj04w== 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-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1764658309; x=1764744709; bh=jOk9hkJ6/TKZGgaULgat3Eo1PPKWysPo3Q6 4E+yBD28=; b=WOO85m7WhxRwcJIlA6PQ6P7GISt4ctY6zrPgWOrMrSKjCtNJclX KFg3oVh2DQ9SA78sPCYvenTIsxdbzS3nwKIWvqWjdT13jQM21aMp0mXvOkj/FTpC T38StS6PNGY7Vrf4g4+nSqbeTg3LF5KZ9B+Xn/ngRidHGBqZ3+rctcvu+YFRT30f 9AX4cP5VJ6Cj8d9W/dYIuw4DqHdfWZRppJZv8PZCDEqWh2TbQ9Z1Ois2OrOQZk8s KH+cufFjvWdIKD3UAnnOKfAv0IbCyDQLYSVwgwXUXiqc+F5KQfnoZPLbYG+XYKQn D25Tr3V+Tl60IT6UrPtssKViZ2cqp4ZZgXw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvheelledtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefoggffhffvkfgjfhfutgesrgdtreerre dtjeenucfhrhhomhepfdftohgsucfnrghnuggvrhhsfdcuoehrohgssegsohhtthhlvggu rdgtohguvghsqeenucggtffrrghtthgvrhhnpeelkeehtdfgfefhleeilefggeeihfekvd elfeejtdfflefhheehfffgudetuddutdenucffohhmrghinhepphhhphdrnhgvthenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrohgssegsoh htthhlvggurdgtohguvghspdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhu thdprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 0EFBF1820054; Tue, 2 Dec 2025 01:51:49 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: AAoQuPDe3_77 Date: Tue, 02 Dec 2025 07:51:28 +0100 To: internals@lists.php.net Message-ID: <9af704c9-00f0-4916-82e2-0b3cafbc390f@app.fastmail.com> In-Reply-To: References: Subject: Re: [PHP-DEV] [RFC] Pattern Matching Content-Type: multipart/alternative; boundary=67c13d50128142caa46601ddb5f96665 From: rob@bottled.codes ("Rob Landers") --67c13d50128142caa46601ddb5f96665 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Mon, Dec 1, 2025, at 22:36, Larry Garfield wrote: > Hi folks. Ilija and I would like to present our latest RFC endeavor, = pattern matching: >=20 > https://wiki.php.net/rfc/pattern-matching >=20 > You may note the date on the RFC is from 2020. Yes, we really have ha= d this one in-progress for 5 years. :-) (Though it was inactive for man= y of those years, in fairness.) Pattern matching was intended as the ne= xt follow up to Enums, as it's a stepping stone toward full ADT support.= However, we also feel it has enormous benefit on its own for simplifyi= ng complex comparisons. >=20 > This RFC has been through numerous iterations, including a full implem= entation rewrite just recently that made a number of features much easie= r. We have therefore included two patterns that were previously slated = for later inclusion but turned out to be trivially easy in the new appro= ach. (Variable pinning and numeric comparison.) >=20 > Nonetheless, there are two outstanding questions on which we are looki= ng for feedback. >=20 > Naturally given the timing, we will not be calling a vote until at lea= st late January, regardless of how the discussion goes. So, plenty of t= ime to express your support. :-) >=20 > --=20 > Larry Garfield > larry@garfieldtech.com One thing I didn't see covered: accessing static variables in a class: class Point { public static $origin =3D new Point(0,0,0); } How do we pattern match to this? Is it the obvious Point::$origin? Same = with class constants? =E2=80=94 Rob --67c13d50128142caa46601ddb5f96665 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
On Mon, Dec = 1, 2025, at 22:36, Larry Garfield wrote:
Hi folks.  Ilija and I would like to pres= ent our latest RFC endeavor, pattern matching:


You may note the da= te on the RFC is from 2020.  Yes, we really have had this one in-pr= ogress for 5 years. :-)  (Though it was inactive for many of those = years, in fairness.)  Pattern matching was intended as the next fol= low up to Enums, as it's a stepping stone toward full ADT support. = However, we also feel it has enormous benefit on its own for simplifyin= g complex comparisons.

This RFC has been throug= h numerous iterations, including a full implementation rewrite just rece= ntly that made a number of features much easier.  We have therefore= included two patterns that were previously slated for later inclusion b= ut turned out to be trivially easy in the new approach.  (Variable = pinning and numeric comparison.)

Nonetheless, t= here are two outstanding questions on which we are looking for feedback.=

Naturally given the timing, we will not be cal= ling a vote until at least late January, regardless of how the discussio= n goes.  So, plenty of time to express your support. :-)
=
-- 
  Larry Garfield