Doc #73117 [Opn->Csd]: Documentation for multiple namespaces in one file needs a clarification.
| From: | peehaa@php.net | Date: | Tue, 20 Sep 2016 08:28:01 +0000 |
| Subject: | Doc #73117 [Opn->Csd]: Documentation for multiple namespaces in one file needs a clarification. | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-13920@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73117&edit=1
ID: 73117
Updated by: peehaa@php.net
Reported by: dominic_mayers at yahoo dot com
Summary: Documentation for multiple namespaces in one file
needs a clarification.
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
-Assigned To:
+Assigned To: peehaa
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
I have removed the user note because it was confusing at best.
Al information is already in http://php.net/manual/en/language.namespaces.importing.php
too.
Previous Comments:
------------------------------------------------------------------------
[2016-09-20 00:20:55] dominic_mayers at yahoo dot com
This is a documentation problem. I don't know what I was thinking when I classed it in
change/feature request.
------------------------------------------------------------------------
[2016-09-19 23:53:47] dominic_mayers at yahoo dot com
Description:
------------
---
From manual page: http://www.php.net/language.namespaces.definitionmultiple
---
Though I cannot see anything wrong with the documentation per se, it seems not sufficient, because
the User contributed notices that have the most up votes are misleading. They confuse the
(unrecommended) non bracketed syntax with the bracketed syntax. They use brackets when they are not
needed. For example, one notice with 78 up votes says:
"use" statements are required to be placed after the "namespace my\space" but
before the "{". e.g.
<?php
namespace foo\bar;
use my\space\MyClass;
{
// place code here
} // end of namespace foo\bar
To make things worst, one notice was trying to correct this confusion, saying that, in the correct
bracketed syntax, the use statements must be within the brackets. This notice received down votes.
So, adding a notice to correct the confusion does not seem to work. Perhaps, there should be an
emphasis that this false bracketed syntax is the same as the non bracketed syntax, but with useless
brackets. Perhaps, to make the point clear, it should be mentioned that it's not possible to
mix namespaces with the unnamed space when we use semi columns after the namespace statements, even
if we add these useless brackets.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73117&edit=1