Re: Re: Clarification on the Enum language structure

From: Date: Wed, 23 Feb 2011 21:33:26 +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 16  Groups: php.internals 
Request: Send a blank email to internals+get-51523@lists.php.net to get a copy of this message
Hi!
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 don't see how you can do it without typing variables and functions and doing static type control. Even then - what if you read values from config file or database? Would you have 50-item switch to match config values to typed Enum values? -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227

« previous php.internals (#51523) next »