# single colon allowed in identifiers

- Thread: https://externals.io/message/921
- Original archive: https://news-web.php.net/php.internals/921
- Started by Greg Beaver on 2003-04-15T04:47:43+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #921 — Greg Beaver — 2003-04-15T04:47:43+00:00

URL: https://externals.io/message/921#921

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
