Is it possible to name a constant a protected word in PHP?
问题 In C#, variables and other things can be named protected names such as "class" by prepending the name with an @ sign. So, @class is a valid name. Is it possible to do this same thing in PHP? I am using a class of constants to simulate an enum for HTML attributes such as ID, and Class. For now I am using "CssClass" but I'd rather use the name Class somehow. 回答1: Nope, not possible, at least not for class constants. You cannot use any of the following [reserved] words as constants, class names,