Take the State of PHP 2026 Survey →

RFC on what namespace separator to choose View as Markdown

Implemented (PHP 5.3)
Authors
Lukas Smith smith@pooteeweet.org
Date
2008-10-25
Version
1.0
Source
wiki.php.net/rfc/namespaceseparator

Discussions on the mailing list

</endnamespacediscussion>
by Lukas Kahwe Smith · 14 messages

RFC text

Copied from wiki.php.net, last synchronized Oct 13, 2026 11:52 UTC

This RFC is the result of a discussion on IRC with Greg, Dmitry, Steph, Derick, Elizabeth, Johannes, Andrei, Scott, Hannes and myself.

Introduction

The purpose of this RFC is to decide on a namespace separator

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

Rating

  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 <pre>\</pre> <pre>**</pre> <pre>^^</pre> <pre>%%</pre> <pre>:> </pre> <pre>:)</pre> <pre>:::</pre>
type-ability +-0 +-0 -1 -1 +-0 +-0 +-0
typo-vulnerability +1 -1 -1 -1 -1 -1 -1
parse-ability +-0 +-0 +-0 +-0 -1 -1 -1
IDE compatibility +1 +1 +1 +1 -1 -1 +1
number of chars +1 -1 -1 -1 -1 -1 -1

Please note that we did not weigh all criterions evenly. Also we only included choices that we still felt relevant. For example as you can see in the IRC logs at the bottom we had already ruled out “::”.

As such we have decided to go with

\

as the new namespace separator instead of the current

::

References

  1. http://wiki.php.net/rfc/backslashnamespaces
  2. IRC discussion that illustrates how we got to the decision of going with a new separator and how we came up with the criteria and the ratings.
  3. previous namespace RFCs:
    1. Namespaces with curly braces
    2. Namespace refinement
    3. Namespace Issues and Solutions

Changelog