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