Re: [RFC] Interface Default Methods
| From: | David Gebler | Date: | Mon, 19 Jun 2023 19:20:10 +0000 |
| Subject: | Re: [RFC] Interface Default Methods | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-120621@lists.php.net to get a copy of this message | ||
On Mon, Jun 19, 2023 at 3:53 AM Levi Morrison <levi.morrison@datadoghq.com>
wrote:
>
> No, there's no attempt to ensure the method body adheres to calling
> the public interface. Due to PHP's possible dynamic behaviors, I don't
> think it's reasonable to attempt to enforce it at compile-time. I'm
> not sure it's worth the effort trying to enforce it at runtime either,
> but it would be nice to see lints from static analysis tools which
> detect this issue.
>
Okay, thanks. That's really quite significant, since it changes the feature
to one which could allow changes made to interfaces to adversely impact
existing clients of an interface without those clients changing a thing.
I was excited by the description of the RFC, but I was imagining something
more like how Java does it. Personally, this limitation (or rather lack of
it) is enough that I wouldn't support it and I'd urge anyone who can vote
to carefully consider the implications of the implementation being proposed..