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
This commit is contained in:
Christoph Michael Becker 2020-03-13 17:37:34 +00:00
parent 916268236f
commit 59d459d265

View file

@ -130,6 +130,12 @@ function connect() { /* ... */ }
]]>
</programlisting>
</example>
<note>
<simpara>
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.
</simpara>
</note>
The only code construct allowed before a namespace declaration is the
<literal>declare</literal> statement, for defining encoding of a source file. In addition,
no non-PHP code may precede a namespace declaration, including extra whitespace: