Re: [RFC] [Discussion] Never parameters

From: Date: Fri, 21 Mar 2025 11:36:01 +0000
Subject: Re: [RFC] [Discussion] Never parameters
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
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

Thread (33 messages)

« previous php.internals (#126893) next »