Hi
Am 2025-03-20 21:04, schrieb Juris Evertovskis:
I'm not opposed to having a bottom type, but the try
/tryFrom
issue feels caused by another shortcoming.
In my viewfrom
and tryFrom
are factory methods that construct an instance by being called on the class itself. As such they should not be subject to LSP at all, just like __construct is not.
Indeed. I said the same in the PR on GitHub: https://github.com/php/php-src/pull/18016#issuecomment-2715887293. Static methods within an interface are not useful.
The never
type would however still be useful for non-static methods in interfaces and to round off the type hierarchy.
Best regards
Tim Düsterhus