Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129517 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 D67521A00BC for ; Tue, 2 Dec 2025 21:18:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1764710285; bh=pnXC3C+XjxftKNh+qjf9B93sGa1lv8UK669+W9TkmCg=; h=Date:From:To:In-Reply-To:References:Subject:From; b=e4WvLIaj6bHcK8Ss8Mnd3Y5jOX1GbOK+C7gOlCOqfedx0Fy6uMfjdf3fc6P+jl1ed iFwexrPNSv1cUupng35T6AZhLzIEarF98iy0wcIceHjwhT/IXq2KNfwcV08X97sh4g UC8iLE/zmF4EAEpV+Z7lKKE/7+JeKnq779LuxQhr3/RPhEz+EztMxYtMJiLNikO1A9 l13ZvH5TZrIm7cVqgQaSvEytPPDILZlOIxS4Psobtf1KSWt7lzLHZL2N87m7TrDMLo r2Uqp1DlUK1lmSGkZe377aa6KSCUfC/6ud7WKz0tzETPfO/Xz28PesgwKwN2Zu5e+T NKQxMPWkmy8Bg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 804601801DB for ; Tue, 2 Dec 2025 21:18: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.9 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 2 Dec 2025 21:18:04 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id D5A3714001BA for ; Tue, 2 Dec 2025 16:17:58 -0500 (EST) Received: from phl-imap-01 ([10.202.2.91]) by phl-compute-04.internal (MEProxy); Tue, 02 Dec 2025 16:17:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; 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=fm1; t=1764710278; x=1764796678; bh=4lWrCkPow19b8VeSB+1p4 zuNE3EvBR/mV0BCOlOXZi8=; b=Kt3rl2VipBkHf/IkbZPC5idlUi8BO2yAea9E7 LVG+hNt4sJpYnffagsNdTyAu7EWnSUsXO+S9FsHrhs0I75kwJOBdSY8LNEp7Laib fR75AZYA9EF23qASj5l50ZZA/sPF5mOd4ZijE2VUUwoNaPWMb4k8eFM8YONRAYgn gn4UUoiVXt0sVCAMAHj4GXaAfKdK9Sf5Y7U2SVAkhAfY1FgHxeyMl1zQ3lfO6Cry lApV1ExWkZGU6uEX+oBTggozrRo5737MvqwY+W7eTnB4fp/hfix6Er9bNN2xDNy1 zIfh17s/RtG9MTqPqU4SnSpD9v5g4LvcV3TOtvwAMAzxS74NQ== 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=fm1; t=1764710278; x=1764796678; bh=4 lWrCkPow19b8VeSB+1p4zuNE3EvBR/mV0BCOlOXZi8=; b=h+BHyp4MaspTn+prs a26WvaqpSRelzIE7690YdaEwvQzprpwG3pG/h/YMO48k4tPT0diiKeQQnP3T6M92 3jh5fL1j9V3+va2MRy3Vx+/0r8it9EBRgK1P5+lFiSZr5F7Ru/aSmcrl81H4/oYE nhyAM/sCxcJdaubhi3h1KvG8v422GZAQloZauX6/Eybg7xCTtVZbZE6ODk2f7/YG Vs+rQK2eq3qd97qFIxfKYPzevQ9XxQAxBtu+HZFvFqMHiXYdYOx/IcbHWePaGfxf iDp+jnn36qf7IvX+9Kw0wh1pXrk8j8vBVWgmZB/4AC0cugEiQKOBBx5Uik/IsmbE 7Ntiw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduudejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh epofggfffhvffkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdfnrghrrhihucfi rghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmqeenuc ggtffrrghtthgvrhhnpeeugfetieejueevffdulefhhfethfekvedtueevgfffvdefiedv tefgheevteelffenucffohhmrghinhepphhhphdrnhgvthenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlught vggthhdrtghomhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtg hpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 1C53918C004E; Tue, 2 Dec 2025 16:17:58 -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: A0wUJIXp2QXJ Date: Tue, 02 Dec 2025 15:17:33 -0600 To: "php internals" Message-ID: <8fc7ffe2-e42d-45c9-ab8b-abeece49d1ec@app.fastmail.com> In-Reply-To: References: Subject: Re: [PHP-DEV] [RFC] Pattern Matching Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Tue, Dec 2, 2025, at 3:13 AM, Alexandre Daubois wrote: > Hi Larry and Ilija, > > Le lun. 1 d=C3=A9c. 2025 =C3=A0 22:37, Larry Garfield a =C3=A9crit : >> >> Hi folks. Ilija and I would like to present our latest RFC endeavor,= pattern matching: >> >> https://wiki.php.net/rfc/pattern-matching > > Thanks for this RFC, it looks really great! > > I see that resources are never mentioned. I know that a lot of > resources are being converted to opaque classes in recent versions, > but they still exist. Would it be possible to use the "resource" type > with pattern matching, e.g. `$r is resource`? I would assume that the > answer is yes because the RFC mentions the support of `$foo is > iterable`. `iterable` is already a type used elsewhere. `resource` is not somethin= g you can specify anywhere in code right now. Making pattern matching t= he one place you can actually type check against `resource`, which is no= t an inconsistency we want. Also, resources are on their way out, gradu= ally, so we'd just need to remove support from pattern matching again in= the future sometime. In all, it's just not worth the effort and inconsistency. --Larry Garfield