single colon allowed in identifiers

php.internals

Greg Beaver

23 years ago
Hi, I've been thinking about the allowance of a single colon as syntactic sugar, and have several considerations to raise: -This code is VERY confusing and should be legal: namespace my:confusion { define("test",6); } namespace my { class confusion { const test = 6; } } $a = (new my::confusion ? my:confusion::test : my::confusion::test); -the #1 question on php.pear.general will become "I tried to use PEAR::Package_Name::Class_Name and it didn't work! Why?" Is it absolutely necessary to prevent the nesting of namespaces, to allow sub-packaging like PEAR::Package_Name? This sub-packaging is a very active part of how PHP is actually being used, and would make a great deal of sense. If the above possibility is out of question, I am strongly in favor of removing the confusion of allowing a single colon. The underscore works just fine (PEAR_Package_Name::Class_Name) Thanks, Greg