Req->Doc #73117 [Opn]: Documentation for multiple namespaces in one file needs a clarification.

From: Date: Tue, 20 Sep 2016 00:20:56 +0000
Subject: Req->Doc #73117 [Opn]: 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-13919@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 User updated by: dominic_mayers at yahoo dot com Reported by: dominic_mayers at yahoo dot com Summary: Documentation for multiple namespaces in one file needs a clarification. Status: Open -Type: Feature/Change Request +Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant Block user comment: N Private report: N New Comment: This is a documentation problem. I don't know what I was thinking when I classed it in change/feature request. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.doc.bugs (#13919) next »