Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129508 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 1BDD91A00BC for ; Tue, 2 Dec 2025 12:28:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1764678515; bh=+Ch6WT4ARMFpTK6N1K89Q6PJEmKWR6iuGAz23tiXyGM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=L3UTK7MrC3lpscmSv0qEbTb0nr89IQV1sTBkQF/mUiuIx14B7qSeLFVAbxnpkgT+k nXgEG5vz42xK+z9K54feK0u8hSjYTZ8JN1rzdhGcX4yLmxkkVTPP7Yqn/a6D8nre7c 2XEH468utkbHCqewCNDrzSYxYS4LlNTOrR+8+rL0Pp8oR07RTo1vhrK/ijftAKT0G6 K2fKwyby12I7CrNiUXif/BbFgHZZp9UOrsvCUxLr3X/2oaqkEbwi5nhBdOvK0kYUnM P2kD4WPOeqXdDHUwdBfO96u1fk5jG859MjyRBH+PzKW97tYG5cu7o61kOujmzpwn3b HdpHsHq1LXdHw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C8472180079 for ; Tue, 2 Dec 2025 12:28:31 +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,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, T_SPF_TEMPERROR autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-yx1-f48.google.com (mail-yx1-f48.google.com [74.125.224.48]) (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 12:28:31 +0000 (UTC) Received: by mail-yx1-f48.google.com with SMTP id 956f58d0204a3-640d0895d7cso7025148d50.1 for ; Tue, 02 Dec 2025 04:28:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764678506; x=1765283306; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=mpV35b1aRiLipPFIzxxfgYCaYfu6PtR+ayUz0wCPIcE=; b=Ry97Fg5PtWZaqqahuF0eOLJcPyaAX0P/MiqLtnDIHdUCw8CVcB09J8bNIMR0Ayj9a1 /UrSSusyNEp2OhBtM0UlEGUdilQIjFSd+82AsS+JvnR7hlOI+xZv+9DBzPvEQL6ZmcQ3 40EJr5INNgqMtDVsSx6nuBfPhpQX8XJYzWbNiaeUxCKyiHgVA3FkA7Ru+cYkED+TDVxz 2zcfQLPx+v7K/bKfA21oGpTPX+IXot1Mov3b3vFPv2mB0NiNtTGZ/X6y+zjNdv4v7KkK OcXKWNgLqZiRTbRp+LlLyNFEM3lKXlySiLHuku7hgoZIWKgx/YekIdPOyAK+XbP1pSH6 7FFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764678506; x=1765283306; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mpV35b1aRiLipPFIzxxfgYCaYfu6PtR+ayUz0wCPIcE=; b=EkNXSgtmR1vE70GBt2bJ5o0npDWghyKaAZcssAnr6Z3Hq+aIhdyKD+LUJjqCwg3kvQ Yvb3UrnYnJL3GvH7fZ7IJp5IWkmO/hTIocdiVyca7GXwG1fongZJoePGDCDRWzMWl1R7 s9XoWWRrsy6g2wfyDnNlO1u2DjUDH5sfARbESznBQr3kXWLo+SJPufvH0XFQx6+Cz9I6 tDhe1UGoSq4+gnfBBJylNnRlePCHo0pTed0fIDILtV2raVLEvIovu92upUz2ep2fqwrr TGH/uLZVu9xEUiaBGgPFEC8HDBcK7AVJaK1WH2zdYWfSOV3n9rMmxoETf8nEqM0DwD5t bJ9A== X-Gm-Message-State: AOJu0Yw24dmB8TpdFYpjzfQ+yjIwqR+iGZ3/2m87lzGU98/HpZP06H7K EfqQanDHVSVn2xBjqj1Da/VHV/Y3SqllIhxxHkYym4deliFxRFp+SswkhI92nLGbmsntB2NNbTO /iFn3Kh+2SHZqhChfl6rBGyOSVGKZ6V8= X-Gm-Gg: ASbGnctx/VcLT4ZSDL2xM3a8ZgyaPGpXvvRsv0N6KQR/qwiSdTw8PbY7FC46htYfY1b sJ3U3NbRXKr4VElCc5IyGybZwcFnfEb091YYQiA2qYkJbXDxCKxQfXR+ZS/a3OOl1HFjGu78OLI EYR0eh5ROTsUxQu2DmJodidcbwJkvgUA6hUgRxLRgYuTU95YUMSylKcdKYse1Yj49XtyBY4otLH DR5sndPAOcyLmOlWXQ+DCrbxwJof6lQaAiaEHOkHBzU262Tq5CXqW7dMR1X4GCiCc1oLA== X-Google-Smtp-Source: AGHT+IHXoac2fAkA64d6E5lL6rseATTNKf8PUfxGV9Xll5YAMqwtY5H+enGoGtHyYJMLYm62DK+94OGKfwUbOA2Us3c= X-Received: by 2002:a05:690e:4143:b0:63f:bb1b:b63a with SMTP id 956f58d0204a3-6442f1450f4mr1446512d50.11.1764678505659; Tue, 02 Dec 2025 04:28:25 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 2 Dec 2025 14:28:07 +0200 X-Gm-Features: AWmQ_bkjQUozme81VTh_a70kooX7dmIHDgerf82hpjtIj4Y5llA507vaHNI-PCU Message-ID: Subject: Re: [PHP-DEV] [RFC] Pattern Matching To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="0000000000007903860644f73b7d" From: drealecs@gmail.com (=?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?=) --0000000000007903860644f73b7d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Dec 1, 2025 at 11:39=E2=80=AFPM Larry Garfield wrote: > Hi folks. Ilija and I would like to present our latest RFC endeavor, > pattern matching: > > https://wiki.php.net/rfc/pattern-matching > > > Great work, very detailed and well written. 1. There are mentions that any type present in a function parameter signature and return value is a valid pattern matching. But are there any plans to extend the pattern-matching-syntax to parameter types and return values? Of course, with some restrictions: without variable pinning.And without variable binding on return type, but that could work on parameter types. If that's possible or already planned, I think it's worth mentioning it in the future scope section. 2. Maybe some parts of the RFC could be separated to reduce complexity. Thinking about variable pinning. 3. For match() "is" placement, I would go with the second form as it's more flexible, but I think allowing both forms might be nice if the complexity is not too high. Or go only with the second form now, and add the first form later in a smaller RFC. --=20 Alex --0000000000007903860644f73b7d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Mon, Dec 1, 2025= at 11:39=E2=80=AFPM Larry Garfield <larry@garfieldtech.com> wrote:
Hi folks.=C2=A0 Ilija and I would like to pres= ent our latest RFC endeavor, pattern matching:

https://wiki.php.net/rfc/pattern-matching



Great work, very detailed=C2=A0and= well written.

1. There are mentions that any type= present in a function parameter signature and return value is a valid patt= ern matching.
But are there any plans to extend the pattern-matching-syn= tax to parameter types and return values?
Of course, with some restricti= ons: without variable pinning.And without variable binding on return type, = but that could work on parameter types.
If that's possible or= already planned, I think it's worth mentioning it in the future scope= =C2=A0section.

2. Maybe some parts of the RFC coul= d be separated to reduce complexity.
Thinking about variable pinning.

3. For match() "is" placement, I would go = with the second form as it's more flexible, but I think allowing both f= orms might be nice if the complexity is not too high.
Or go only= =C2=A0with the second form now, and add the first form later in a smaller R= FC.


--=C2=A0
Alex

--0000000000007903860644f73b7d--