On Wed, Dec 17, 2025, at 10:49 AM, Korvin Szanto wrote: > That all said, I think there's enough here that this could pass an > entrance vote and some of the questions around generics and enforcing > invariance can be answered in the draft phase over time. If we're > lucky, usable generics will land in PHP before this PSR is finalized.
I would not bet on any such luck... :-) I am still not convinced that interfaces are even the right solution here. If we want to have a standard result type in PHP... it should be a full on type: A concrete class. Which means probably coming from a PER, not a PSR. That said, I am still not convinced that it's meaningfully useful without native generics. PHPStan/Psalm generics are *fairly* well supported these days, but not universally. And if we did something without generics, then PHP does somehow get generics... upgrading will be a mess. And of course, I must note that Ilija and I are still trying to work toward ADTs, which would be the proper tool to represent a result type, aka Either Monad. :-) I would be surprised if they make it into 8.6, but 8.7 is not out of the realm of possibility. And I keep pushing for integrating Either into the language via checked lightweight exceptions, but so far no one on Internals is listening to me. :-P I would probably vote No on a PSR interface at this point. It would be the wrong approach, and the ecosystem is not quite ready yet. Of course, either way we'd still need buy-in from major players and a working group. That step needs to come *before* detailed design work happens, so the current discussion on the PR is not particularly relevant. --Larry Garfield -- You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/php-fig/69020282-d776-4ebc-8181-148bb17d3a9f%40app.fastmail.com.
