Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129931 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 E2CEC1A00BC for ; Mon, 26 Jan 2026 13:34:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1769434446; bh=EKjfYJS5Ay6IigOvoWbIs6P9JHoImpYMjXa1EQNrOxw=; h=Date:Subject:To:References:From:In-Reply-To:From; b=Pnt56auDsqCmYGyXamfYvVqzoofIB1EKDyLC2DJIAouX+ds82sTe+GrheQDhvkhRC UO9ea8RW1bdPxlhQmNIsK8ERa/lOT/EXOE6ljTTQesKwXSqO94m8saiIBX7zr0jfVJ l4j3VeAUMVGaZ+db4E/dtT6ABmGKeNb//D0qJ00ABks6DDzw31WXR0v4G8mdAyU2N4 el11rbzVSFoXpd8yvK8JMoq2fHBDLdda4rGcfmSEZCPxCdXAsMupIkH/JiIA3YmdWR lUXAt0S3nTn1CpyeCTxGjGiJJNhcL02foqIQxvgpcj/ktlDWrzsTCg1DF0blaYptzZ 2k1vqXXyVgCwA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1C041180072 for ; Mon, 26 Jan 2026 13:34:04 +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.8 required=5.0 tests=BAYES_50,DMARC_MISSING, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from jessie.smtp.mailx.hosts.net.nz (jessie.smtp.mailx.hosts.net.nz [43.245.52.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 26 Jan 2026 13:33:52 +0000 (UTC) Received: from 122-57-27-239-adsl.sparkbb.co.nz ([122.57.27.239] helo=[192.168.1.67]) by jessie.smtp.mailx.hosts.net.nz with esmtpsa authed as varteg.nz (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim 4.96) (envelope-from ) id 1vkMiu-0058GJ-1G for internals@lists.php.net; Tue, 27 Jan 2026 02:33:44 +1300 Message-ID: Date: Tue, 27 Jan 2026 02:33:36 +1300 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [RFC] Pattern Matching To: internals@lists.php.net References: <56dce794-a512-421a-a8d2-91a9692c1ab4@app.fastmail.com> <23093833-bdd2-442d-86b8-9ef492c51ad1@app.fastmail.com> <49cb415d-adb9-408d-82af-b71f6de234ad@varteg.nz> Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Hosts-DKIM-Check: none From: weedpacket@varteg.nz (Morgan) On 2026-01-26 23:53, Bruce Weirdan wrote: > > > On Mon, Jan 26, 2026 at 5:48 AM Morgan > wrote: > > > On 2026-01-26 07:44, Larry Garfield wrote: > > > > > > With per-arm, you can opt-in to pattern matching individually, at > > the cost of having to remember to repeat the keyword on every line. > > With per-block, you only have to add the keyword once at the cost of > > > not being able to selectively use patterns or identity matching. > > > > > > Which tradeoff is better is the option question.  (Ilija and I > > disagree on which to go with.)  Or, if someone can suggest a way to > > allow automatic detection reliably, that would also be most welcome. :-) > > > > > > > If it had to be one or the other [...] > > > Does it have to be one of the other though? Can't we have both? > > > ...so the real question is if "match($foo) is {..." should be added as a shorthand for when all matching is on patterns.