Re: [RFC] [Discussion] `#[\Override]` for class constants
| From: | Derick Rethans | Date: | Tue, 31 Mar 2026 09:56:34 +0000 |
| Subject: | Re: [RFC] [Discussion] `#[\Override]` for class constants | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-130512@lists.php.net to get a copy of this message | ||
On Mon, 30 Mar 2026, Daniel Scherzer wrote:
> I'd like to start the discussion for a new RFC about adding support for
>
#[\Override] for class constants.
>
> * RFC: https://wiki.php.net/rfc/override_constants
> * Implementation: https://github.com/php/php-src/pull/20478
>
> I'd also like to draw specific attention to the open question, which I am
> soliciting feedback on: how should #[\Override] work for enum
> cases? See
> the RFC page for details.
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