php namespace seperator
28/10/2008For those of you who are keeping up with the latest developments of the PHP language, you will know tha they finally decided on the serperator used to seperate namespaces, and to almost everyone’s horror they went with…
\
…that’s right, a bloody backslash. I think Paul Jones summed up what we are all thinking in his i.m. transcript.
Ok, so pretty much everyone agrees, that a backslash, blows…but what could be used as an alternative, I know a few people have suggested a single dot (foo.bar()) but this will make it ambiguous withs string concatenation. The original contenders were as follow (assuming the namespace foo):
- foo\bar()
- foo**bar()
- foo^^bar()
- foo%%bar()
- foo:>bar()
- foo:)bar()
- foo:::bar()
I think the triple colon would have been my shout, sure it’s an extra character, but it fits in well with what we know so far. Would love to hear other people’s opinion on what they would prefer, if their not happy with the backslash.
There are 2 comments in this article: