Re: Re: internals Digest 22 Feb 2012 22:13:24 -0000 Issue 2561

From: Date: Fri, 24 Feb 2012 17:07:23 +0000
Subject: Re: Re: internals Digest 22 Feb 2012 22:13:24 -0000 Issue 2561
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-58003@lists.php.net to get a copy of this message
2012/2/24 Dmitri Snytkine <dsnytkine@ultralogistics.com> > In order to intoduce the enum into php, 'enum' will have to be a keyword > like 'class', 'interface', etc. > > Just a thought, but could there be a problem with using the new keyword > 'enum' in php. I don't think it's currently a reserved word, so it could > potentially cause problems if a script uses the word enum for existing > variable name or a function or a class name? > It's true. "enum" is still not a reserved word. So yes, introducing native enum with this keyword would have this kind of side effect. I'll explain more the side effect: - it create a parse error - the world only is in trouble: "something_enum" or "enum_somthing" - it happens with function, method, class, interface ... names, but not variables, the "$" char save them - it happens a case-incensitive way -- Samuel DEAL samuel.deal@gmail.com

« previous php.internals (#58003) next »