Re: [RFC] [Discussion] `#[\Override]` for class constants
| From: | Daniel Scherzer | Date: | Thu, 16 Apr 2026 02:11:20 +0000 |
| Subject: | Re: [RFC] [Discussion] `#[\Override]` for class constants | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-130657@lists.php.net to get a copy of this message | ||
On Tue, Mar 31, 2026 at 2:56 AM Derick Rethans <derick@php.net> wrote:
>
> I think I'm on the " Always reject using #[\Override] on an enum case,
> saying that the attribute does not target enum cases" side here, as
> mixing class constants with enum cases sounds like a mismatch to me.
>
> cheers,
> Derick
>
On the other hand, if someone is intentionally overriding an interface
constant with an enum case, all the more reason that the overriding should
be explicitly documented, which is what
#[\Override] would do.
-Daniel