Re: Re: Clarification on the Enum language structure

From: Date: Wed, 23 Feb 2011 10:12:55 +0000
Subject: Re: Re: Clarification on the Enum language structure
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  Groups: php.internals 
Request: Send a blank email to internals+get-51509@lists.php.net to get a copy of this message
Are you suggesting this as an enum member function, or just a regular function in any old class?
"Enum member funcion"? How much it should be like a class before you call it a class?
Exactly. It's crazy. If you want a 'member function' use a class, not an enum.
use the function: you would usually be expected to pass in a true enum constant of the MyEnum type.
That works wonders in dynamic languages, without any means of really ensuring it.
No, I believe you can ensure it, and you can even ensure it efficiently. I outlined this in a more lengthy email earlier today. I was against type hinting until I realised that yes, it could work, and work efficiently. Ben.

« previous php.internals (#51509) next »