Re: [DISCUSSION] Class Constant Enums?
| From: | Mike Schinkel | Date: | Fri, 16 Aug 2024 05:58:10 +0000 |
| Subject: | Re: [DISCUSSION] Class Constant Enums? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-124971@lists.php.net to get a copy of this message | ||
> On Aug 15, 2024, at 9:37 PM, Nick Lockheart <lists@ageofdream.com> wrote:
>
> Hi,
>
> Is there any interest in having enums as class constants?
> I'm often finding cases where I would like to have an enum inside of a
> class, but don't want a free-floating enum that's basically like
> another class.
>
> When dealing with state, it's nice to have a human readable const to
> represent that state, but I always feel like they should be grouped
> together.
Yes, I would very much like that.
-Mike
P.S. See related: https://externals.io/message/107995 <https://externals.io/message/107995>