Doc #53133 [NEW]: Scope of use keyword is not documented.

From: Date: Fri, 22 Oct 2010 04:01:51 +0000
Subject: Doc #53133 [NEW]: Scope of use keyword is not documented.
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-5319@lists.php.net to get a copy of this message
From: Operating system: All PHP version: 5.3.3 Package: Documentation problem Bug Type: Documentation Problem Bug description:Scope of use keyword is not documented. Description: ------------ It seems to me that http://www.php.net/manual/en/language.namespaces.importing.php is supposed to be the main documentation of the 'use' keyword for importing namespaces. If that's the case, it is woefully inadequate. Please, look at the language references for any other modern language, and add some documentation on the scope of the operator. Does it have till-end-of-current-file scope? or is it block-scoped? If a file is included, using 'include' for example, is the outer code affected by the 'use' statements within the include. The same questions go for the namespace operator itself. If I do this, to protect users of my library from name clashes: namespace MyLibrary { use AnotherLibrary; //my library. } is only code within the {} affected by the 'use'? or does code that includes my php file suddendly have AnotherLibrary also added to their toplevel namespace? or do they have MyLibrary\AnotherLibrary ? Unless you properly document this, people have to try to make reasonable guesses about these things, or find them out by trial and error. ie by not documenting it you just leaving it as 'implementation dependent'. If there is some other more canonical reference about the language, please add links to it in the manual above! -- Edit bug report at http://bugs.php.net/bug.php?id=53133&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53133&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53133&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53133&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53133&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53133&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53133&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53133&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53133&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53133&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53133&r=support Expected behavior: http://bugs.php.net/fix.php?id=53133&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53133&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53133&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53133&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53133&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53133&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53133&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53133&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53133&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53133&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53133&r=mysqlcfg

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