Req #73117 [NEW]: Documentation for multiple namespaces in one file needs a clarification.
| From: | dominic_mayers at yahoo dot com | Date: | Mon, 19 Sep 2016 23:53:49 +0000 |
| Subject: | Req #73117 [NEW]: Documentation for multiple namespaces in one file needs a clarification. | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-13918@lists.php.net to get a copy of this message | ||
From: dominic_mayers at yahoo dot com
Operating system:
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Feature/Change Request
Bug description:Documentation for multiple namespaces in one file needs a clarification.
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 bug report at https://bugs.php.net/bug.php?id=73117&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73117&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73117&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73117&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73117&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73117&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73117&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73117&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73117&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73117&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73117&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73117&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73117&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73117&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73117&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73117&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73117&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73117&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73117&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73117&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73117&r=mysqlcfg