From eb41c5d7b3755ce421723a0a46bd9d4e309c0481 Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Sun, 24 Oct 2010 14:14:59 +0000 Subject: [PATCH] Fixed bug #53133 (Scope of use keyword is not documented) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@304702 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/namespaces.xml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/language/namespaces.xml b/language/namespaces.xml index b5ba1f03ba..b23395a86d 100644 --- a/language/namespaces.xml +++ b/language/namespaces.xml @@ -681,6 +681,42 @@ $obj = new \Another\thing; // instantiates object of class Another\thing + + Scoping rules for importing + + The use keyword must be declared in the + outermost scope of a file (the global scope) or inside namespace + declarations. This is because the importing is done at compile + time and not runtime, so it cannot be block scoped. The following + example will show an illegal use of the use + keyword: + + + + Illegal importing rule + + +]]> + + + + + + Importing rules are per file basis, meaning included files will + NOT inherit the parent file's importing rules. + + + Global space