YES PLEASE.


I constantly find myself, day after day, in situations where I wish enumerators were a thing. They prevent so many issues, they make code so much more legible. You can get by with mimicking them using class constants, but it’s crazy that formal enums haven’t been implemented yet.
That would be a great addition. I miss it from C# and the TypeScript implementation is really sweet
It’s a very needed feature indeed. Yes!
The only thing that kinda throws me off is the use of the word “case” all the time. Couldn’t that be omitted? Be more like C#/Java?
🍿
I love how this has capability to add behavior to these, specifically to allow for the mapping of values to labels. I’ve written my own pseudo enum library that does this because it’s very handy to have an enum responsible for encapsulating things like display values rather than having to create a separate presenter for each enum.
I dig this RFC. Seems to add some nice robustness to enums in PHP.
oh, here we go guys and gals
PHP 8 has many nice additions and with thIs PHP 8.1 will ba a blast. Wow things are really looking good for PHP 8 now and beyond.
Members
Online

source