If you don't read the
PHP Internals mailing list, you've probably missed most of the recent discussion on namespaces.
Since you're reading this entry, there's a good chance you've read one of the other posts about the
results of the 2005 PDM, though.
Of particular interest (especially given the recent Date class
debacle) is the point on
namespaces.
At the meeting, the core developers decided that "\" is a logical choice for the namespace operator as it is the only single non-alpha-numeric character on (US) keyboards that isn't yet an operator.
This has been met with
some resistance.
For some reason, people don't seem to think that "\" is a good choice for the namespace operator. I'm not sure why this is... \ seems logical to me.
UPDATE: As you see, the title was changed from Shaloshayim Nekudotayim to Shalosh Nekudotayim. Check the comments--thanks Hebrew speakers.
Jessie Hernandez (the author of one of the
existing namespace patches) originally proposed the use of ":" (as in "namespace:class::var").
This was rejected by the core developers because : is already an operator: it is used in the
ternary operator. It would make things like the following break:
PHP:
<?php
$foo = $bar?moo:oink:meow;
?>
So, if $bar is true, does $foo become moo:oink? or oink:meow? So, no good.
One solution is to enforce whitespace around the ternary colon:
PHP:
<?php
$foo = $bar?moo:oink : meow;
?>
I hope this never makes it into PHP. Fortunately, Rasmus has already
denied it.
So, there have been a number of other ideas. Most of them are simply impossible ("." ? Seriously... it's the concatenation operator!).
I have absolutely no problem with "\". Some people have argued that "\" looks too much like "/". This is simply bogus. The same people think that ":" vs ";" is OK, but it's essentially the same comparison.
Barring \ (for whatever reason), I would like to see ":::". Yes, it's a little longer than the other operators, but who really cares? It's ONE extra keypress (you've already got shift held down from the previous colon.) Even Ilia
agrees.
Why ::: ? Well, it makes sense. :: resolves scope, ::: should resolve the scope's scope. Right?
So, what's with the title of this entry, you ask? I had to do a little research to come up with it, and it might be completely wrong as I don't speak/write Hebrew, but, since :: is called "Paamayim Nekudotayim" (or "double colon" in English), I propose "Shaloshayim Nekudotayim" which (hopefully) means "triple colon." Feel free to correct me (-:
S