Re: RFC [Discussion]: Marking overridden methods (#[\Override])
| From: | Ilija Tovilo | Date: | Mon, 22 May 2023 12:21:42 +0000 |
| Subject: | Re: RFC [Discussion]: Marking overridden methods (#[\Override]) | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-120386@lists.php.net to get a copy of this message | ||
Hi Tim
On Thu, May 11, 2023 at 6:37 PM Tim Düsterhus <tim@bastelstu.be> wrote:
> I'm now opening discussion for the RFC "Marking overridden methods
> (#[\Override])":
>
> RFC: Marking overridden methods (#[\Override])
> https://wiki.php.net/rfc/marking_overriden_methods
We've already talked in private, but let me state my position here as well.
The implementation is quite simple (~60 lines of non-whitespace,
non-generated C code), and does not introduce any new syntax that
parsers/static analyzers are *forced* to handle.
The RFC shows that there is a benefit for code using the attribute,
namely showing intent to the reader, reducing the risk of typos and
being more resistant to errors when refactoring / upgrading library
versions. Having the feature supported by the engine, while not
strictly necessary, allows users who don't use static analyzers to
profit from it, and define consistent semantics for static analyzers
to follow.
The benefits seem worth the maintenance cost, even if small for the
average user.
Ilija