From 59d459d265d56bcfc4e6691bfc277a69b383da84 Mon Sep 17 00:00:00 2001 From: Christoph Michael Becker Date: Fri, 13 Mar 2020 17:37:34 +0000 Subject: [PATCH] Fix #74257: "namespace \X" does not work to declare a namespace git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@349407 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/namespaces.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/language/namespaces.xml b/language/namespaces.xml index 64090d3836..58c65ed608 100644 --- a/language/namespaces.xml +++ b/language/namespaces.xml @@ -130,6 +130,12 @@ function connect() { /* ... */ } ]]> + + + Fully qualified names (i.e. names starting with a backslash) are not allowed in namespace + declarations, because such constructs are interpreted as relative namespace expressions. + + The only code construct allowed before a namespace declaration is the declare statement, for defining encoding of a source file. In addition, no non-PHP code may precede a namespace declaration, including extra whitespace: