Doc #53133 [Opn->Csd]: Scope of use keyword is not documented.

From: Date: Sun, 24 Oct 2010 14:15:07 +0000
Subject: Doc #53133 [Opn->Csd]: Scope of use keyword is not documented.
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-5398@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53133&edit=1 ID: 53133 Updated by: kalle@php.net Reported by: longhairedgit+bugs dot php dot net at gmail dot com Summary: Scope of use keyword is not documented. -Status: Open +Status: Closed Type: Documentation Problem Package: Documentation problem Operating System: All PHP Version: 5.3.3 -Assigned To: +Assigned To: kalle Block user comment: 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. Previous Comments: ------------------------------------------------------------------------ [2010-10-24 16:15:01] kalle@php.net Automatic comment from SVN on behalf of kalle Revision: http://svn.php.net/viewvc/?view=revision&revision=304702 Log: Fixed bug #53133 (Scope of use keyword is not documented) ------------------------------------------------------------------------ [2010-10-22 06:01:51] longhairedgit+bugs dot php dot net at gmail dot com 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 this bug report at http://bugs.php.net/bug.php?id=53133&edit=1

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