Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123746 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 7A6FA1A009C for ; Sat, 22 Jun 2024 02:13:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719022490; bh=x5g2YFpPicvgynxcLLFoLpu+QyrOdoSL3VVRrkn8nOY=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=G7LgjtPu6drIS8inGZxZloFSwZN1UlFnB6ud33N0XmwnIuj12pTk86c8q3BvzgU8g leH9wK4cAXCng1MH4S0ui/iNKtIsbfGAUyat+x2r4YPjcfShnpqcjLr6iFFJdJBrxe TLOB+CjGeLJgWx7MV8XDv/O4olJ2X2B90k3yZcFTxiTK7zzgB0ZzOAOXUdIy1TyYbv zIYZmZeBunMEqBoyklEqaHxknCmIRyKAgAv7sO3QRd/XHh/IuZJhnKr7aGXH8rsfli nQb7bl3qnMWdnh2Ht6nL1ay1N2GKWCs51CujoLVk+VdFygxjJRHjzMCIkqAIpI1T5k CTP9vUcczLAkQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4D6C4180068 for ; Sat, 22 Jun 2024 02:14:49 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-40136.proton.ch (mail-40136.proton.ch [185.70.40.136]) (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, 22 Jun 2024 02:14:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpb.moe; s=protonmail; t=1719022411; x=1719281611; bh=x5g2YFpPicvgynxcLLFoLpu+QyrOdoSL3VVRrkn8nOY=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=LIezkj8u+T/iAOXw/k93Zy+c4RfBV7tG2cw/eyD8s68pay/aiM2hAwKQibRzBqIjF QwdSG11xVaQixcZafNOA/S5oOpnR3Ykc/htbxdLWs5G6dZ0f0ytup7Xgyj6ZZQULZN 2s1oY9DvdcOUPYNgBD/jGbyToOrPA7Ncsu2fZujrnXtj/5E535girrHt0h+T2m1HFt QJPWnQbatMsq0IFeN2Uqj/6kTN3mYj4ueDBr3Hh/7GmC1xpLAt4HWjNimpaUHYRNN3 c9+rGA1A2ANeu94qbvTWAYyxIzHKK65sifl7Ki5gu0vp54K9N5KnJ02CyDqyYaoCIA q9wL9+2l1SYtA== Date: Sat, 22 Jun 2024 02:13:28 +0000 To: Larry Garfield Cc: php internals Subject: Re: [PHP-DEV] [Early Feedback] Pattern matching Message-ID: In-Reply-To: References: <2a6b92eb-d5e9-4a1a-9548-a068ac42ebd2@app.fastmail.com> Feedback-ID: 96993444:user:proton X-Pm-Message-ID: 9a0f31a66f202973b32fb626c957fd7118ebb146 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: internals@gpb.moe ("Gina P. Banyard") On Friday, 21 June 2024 at 19:19, Larry Garfield w= rote: > On Fri, Jun 21, 2024, at 3:35 PM, Brandon Jackson wrote: > > 4. Object matching > > Absolutely a separate rfc please. Definitely needs discussion. Could > > intersect another potentially preferred solution like type aliases. > > Sending one or the other into anti-pattern world. > > Maybe a solution similar to this would be preferred: > >=20 > > `php type MyType =3D Foo&Bar $foo =3D $bar as MyType|string` >=20 >=20 > As noted, this is on the ADT hot path so postponing it is problematic. Es= pecially holding it on type aliases, which have been discussed for longer t= han this RFC has been around (nearly 4 years) and yet no actual proposal ha= s ever been put forward. It's unwise to wait for such a feature, especially= when most likely implementations would dovetail well with patterns anyway. I agree with Larry here, this is core to pattern matching in general and ne= cessary for ADTs to make any sense (and I want them yesterday). Moreover, I cannot see how this will conflict with anything vaguely close t= o type aliases. Best regards, Gina P. Banyard