php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #46713 Sub-namespace example lacks delimiter
Submitted: 2008-11-28 18:28 UTC Modified: 2008-11-28 18:53 UTC
From: mbr at arlsoft dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: Whatever php.net's server runs
Private report: No CVE-ID: None
 [2008-11-28 18:28 UTC] mbr at arlsoft dot com
Description:
------------
Your documentation page at http://www.php.net/manual/en/language.namespaces.nested.php gives the following example use of the "namespace" keyword for declaring sub-namespaces:

namespace MyProjectSubLevel;

Below the example, it explains, "The above example creates constant MyProject\Sub\Level\CONNECT_OK, class MyProject\Sub\Level\Connection and function MyProject\Sub\Level\Connection."

Yet the name of the namespace given in the example contains no delimiters.  I don't see how the PHP interpreter can know that "MyProject" is the first level namespace, "Sub" is the second level namespace, and "Level" is the third level namespace.  So I'm guessing that the line in the example is missing some delimiter.  Given that many Unix tools use the character "\" to quote the following character, it seems possible that whoever wrote the documentation inserted a single backslash where what was needed was to have the backslash itself quoted by being preceded by another backslash.

Please check and fix the documentation, and make it clear exactly which character PHP recognizes as the delimiter between multiple levels of a namespace hierarchy.






Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-28 18:34 UTC] philip@php.net
Duplicate of bug #46710

This will be fixed this upcoming Friday.

You may use the docs.php.net server for now.

http://docs.php.net/manual/en/language.namespaces.nested.php
 [2008-11-28 18:45 UTC] mbr at arlsoft dot com
Before I reported this, I did search the bug-tracking system, but I didn't find bug #46710.

Thanks for the pointer to the docs.php.net server.
 [2008-11-28 18:53 UTC] philip@php.net
Yeah, this bug is a little tricky to find because it's technically not a documentation problem but rather a fairly recent 5.3 highlight_string() is needed to understand namespace syntax while building the manual... 
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Fri Oct 09 00:00:01 2026 UTC