Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129498 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 A7F5C1A00BC for ; Tue, 2 Dec 2025 01:25:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1764638709; bh=/OppmBvVK0rPdhDFKIbwRwWCP6qFx1i2kh4Pjlv1azw=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=X+9rQrvbqLpSroof5p8Wcve3cHCPxpQyYXa87q7uWjOKb1sxVPJh22DOKEaWj+c/O 71WAGGApjMVfJJoueCVw7hilHt/NWh4r5VxaZZE7ORRPjMkY2j+Wh85CLMTUlEGl3s /sI6ZXmPVO26tl2eCxOH2qJboPhlpzWoDNLuxGGWnr+6LiD2U9qR8DPAOYuTbDkZOJ 64KmuBhpS4RyvoQZwPOxjH2fkhsRrNgdCHaBSH6gUSyrT+Kn+o40Zkh+8Kt7DTcXYc GUUlEwUr6LZ5tuChzYpJ/qNCloMWbHgpPMHz5qElJ1PCK/QanKhGL1baW7EYyeMM3R JFB5TgXdmYYPQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1292C18005B for ; Tue, 2 Dec 2025 01:25:08 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail1.25mail.st (mail1.25mail.st [206.123.115.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 2 Dec 2025 01:25:07 +0000 (UTC) Received: from smtpclient.apple (unknown [49.48.221.114]) by mail1.25mail.st (Postfix) with ESMTPSA id 9AD0760462; Tue, 2 Dec 2025 01:24:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=koalephant.com; s=25mailst; t=1764638701; bh=/OppmBvVK0rPdhDFKIbwRwWCP6qFx1i2kh4Pjlv1azw=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=X7L02a6sPvNt+64jpf73f4GtHh0nXw4Flbq+U/gf9YyzN/Q9krLNfjBz0A9l7YS64 5ss0cZTfqbInGwaJQDZ8OEEElymQuEs6Jx61OQ67z1H4/X+tNK5hSicwJf6KBFejVA v1hYECsiilQSBn1jZi+AHIiJRnNn8liypqEeCiXq16a1UOKU1GFqLGrH1t55NY8Gif JAc4G1JEmDj3BPxx0l1pKzSrhDcjBsSieoYgIwWP9fcJv5eStPfjR0JdjVfxGMzvJE g/qj5wB6VgF+xYQQtbYl0rEJaUsADibPSsABXC4VfD9ushhN52JzKVg4ms/AC7dwG6 qv1RPN8IMxLUw== Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow Mime-Version: 1.0 (1.0) Subject: Re: [PHP-DEV] [RFC] Pattern Matching Date: Tue, 2 Dec 2025 08:24:43 +0700 Message-ID: <6FCEAC03-2EAD-440D-8D8B-6D014C16C149@koalephant.com> References: Cc: php internals In-Reply-To: To: Larry Garfield X-Mailer: iPhone Mail (22G100) From: php-lists@koalephant.com (Stephen Reay) > On 2 Dec 2025, at 04:45, Larry Garfield wrote: >=20 > =EF=BB=BFHi folks. Ilija and I would like to present our latest RFC endea= vor, 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 had th= is one in-progress for 5 years. :-) (Though it was inactive for many of tho= se years, in fairness.) Pattern matching was intended as the next follow up= to Enums, as it's a stepping stone toward full ADT support. However, we al= so feel it has enormous benefit on its own for simplifying complex compariso= ns. >=20 > This RFC has been through numerous iterations, including a full implementa= tion rewrite just recently that made a number of features much easier. We h= ave therefore included two patterns that were previously slated for later in= clusion but turned out to be trivially easy in the new approach. (Variable p= inning and numeric comparison.) >=20 > Nonetheless, there are two outstanding questions on which we are looking f= or feedback. >=20 > Naturally given the timing, we will not be calling a vote until at least l= ate January, regardless of how the discussion goes. So, plenty of time to e= xpress your support. :-) >=20 > -- > Larry Garfield > larry@garfieldtech.com >=20 Hi Larry,=20 Is there a specific reason why less than/etc comparison (and the future scop= e of ranges) is limited to numerics? 'A' < 'K' comparisons are already in the language, and range() accepts stri= ng arguments to produce an array of bytes. Cheers Stephen=