On 18 September 2015 01:49:35 BST, John Bafford <jbaff...@zort.net> wrote: >an important benefit to providing a value for enums would be to allow for >changing or deprecating enums. So you might want to say something like: > >enum FormEvents { > PRE_SUBMIT, > PRE_BIND = PRE_SUBMIT, //deprecated name, provide mapping to new name >}
I'm not sure whether I like it or not, but I note that Python allows this: every enum member must have a value, which can be of any type; if two members are given the same value, the later defined one is considered an alias of the first. There is a method to select an instance by value, which will always return the first member with that value, not the alias. The examples also include lots of ways of using the value with overloaded operators etc. Regards, -- Rowan Collins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php