> Am 18.09.2015 um 10:42 schrieb Rowan Collins <rowan.coll...@gmail.com>:
> 
> On 18 September 2015 01:15:43 BST, Bob Weinand <bobw...@hotmail.com> wrote:
>> The reason it is not an associative array is that the names are not
>> important.
> ...
>> You never should *rely* on the ordinal value of the enum for anything.
> 
> I feel like I'm missing something here. In my mind, the only absolute 
> universal about all enum implementations is that you refer to values by 
> constant names - e.g. Weekdays::SUNDAY. The name 'SUNDAY' is as fundamental 
> and unchanging as the name 'Weekdays'.
> 
> We rely on names to reference classes and functions all the time, and to 
> serialize properties of an object; so what is it about enums that makes 
> having an integer accessible so important?
> 
> I note that Java does supply an ordinal(), but the docs say you should 
> basically never use it.
> 
> Regards,
> -- 
> Rowan Collins
> [IMSoP]

Well, I think we should *either* have an ordinal *or* a name.
But not both.

Currently, after thinking about it, I'm in favor of just a name. And no ordinal.
Having both is, I think, unnecessary.

Bob
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to