Re: [RFC] Pattern Matching

From: Date: Tue, 02 Dec 2025 12:28:07 +0000
Subject: Re: [RFC] Pattern Matching
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-129508@lists.php.net to get a copy of this message
On Mon, Dec 1, 2025 at 11:39 PM Larry Garfield <larry@garfieldtech.com> 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. -- Alex

« previous php.internals (#129508) next »