On 1 Mar 2025, at 00:28, Tim Düsterhus <t...@bastelstu.be> wrote: > >> Anyway, I would love to try and push this idea forward – either by >> contacting Kacpar, or writing my own RFC – and have a shot at implementing a >> proof of concept, but first I would like to get a feel for whether this >> proposal would find much footing here. > > I guess the pattern matching RFC could be the solution to what you are > looking for and I suggest to have a look: > > https://wiki.php.net/rfc/pattern-matching > > and > > https://externals.io/message/123701
I see! I had skimmed through it before but now upon closer inspection it does seem to fulfill some of my wishes. However, it seems the ability to actually use pattern matching as a structural interface hinges on whether it will be possible to declare patterns as types, which as of now seems to be under consideration. I may need to throw my two cents into that RFCs thread. Thanks for the heads up! Alwin