PHP to use backslash as namespace separator

PHP is going to have backslashes for namespace separator.

Thx to the initiative of Scott and Steph we had an IRC discussion with several code developers. The result is that we have decided to go with backslash as new separator for namespaces.

As the patch is still under development it is yet unclear how this will affect the scheduling PHP 5.3. (Source: PHP internals)

Criterions

  • (1) type-ability (how easy is it to type the separator)
  • (2) typo-vulnerability (how easy is it to make a typo and get an unwanted behavior without a error/warning)
  • (3) parse-ability (how easy is it to read the code and figure out whats going on without getting confused with similar syntax that means another thing)
  • (4) IDE compatibility
  • (5) number of chars

Ratings

  1. +1 means the separator is not affected negatively by the criteria
  2. +-0 means that the separator is only moderately affected by the criteria
  3. -1 means the criteria is severely affected by the criteria
critieria
\
**
^^
%%
:>
:)
:::
(1) +-0 +-0 -1 -1 +-0 +-0 +-0
(2) +1 -1 -1 -1 -1 -1 -1
(3) +-0 +-0 +-0 +-0 -1 -1 -1
(4) +1 +1 +1 +1 -1 -1 +1
(5) +1 -1 -1 -1 -1 -1 -1

(Excerpt from PHP RFC)

I would much prefer the :> smiley but I would suppose the other developers not having as much favor to that. Backslashes are okay I guess. I am more used to periods though.

backslash\backslash\backslash\kaboom.

One thought on “PHP to use backslash as namespace separator”

  1. This is really troublesome… backslashes are typable only on QWERTY keyboards… PHP Devs do not like NON-English people ? ;-)

    I’m really not interested in modifying my code to follow those rules…

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>