|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80041 Multi-line namespace no longer works with PHP 8
Submitted: 2020-08-31 18:16 UTC Modified: 2020-08-31 18:22 UTC
From: w1djmartin at gmail dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 8.0.0beta2 OS: Windows 10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: w1djmartin at gmail dot com
New email:
PHP Version: OS:


 [2020-08-31 18:16 UTC] w1djmartin at gmail dot com
Prior to PHP 8 Beta 1 splitting a namespace across multiple lines would work without error. Starting with PHP 8 Beta 1 a namespace that is split across multiple lines results in a parse error/syntax error.

Test script:
namespace Foo

echo __NAMESPACE__;

Expected result:
The test script should output: Foo\Bar\Baz

Actual result:
The test script throws an error: Parse error: syntax error, unexpected fully qualified name "\Bar", expecting "{" 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-08-31 18:20 UTC] w1djmartin at gmail dot com
You can easily see how the result changes at
 [2020-08-31 18:22 UTC]
-Status: Open +Status: Not a bug
 [2020-08-31 18:22 UTC]
That is correct: namespace names are now one whole unit, not multiple names with slashes in between.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 15 15:01:29 2024 UTC