|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #73347 Propose new namespace separator: dot inside a string
Submitted: 2016-10-19 10:48 UTC Modified: 2016-10-25 15:26 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: fede dot carg at gmail dot com Assigned:
Status: Suspended Package: Class/Object related
PHP Version: 7.1.0RC3 OS:
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: fede dot carg at gmail dot com
New email:
PHP Version: OS:


 [2016-10-19 10:48 UTC] fede dot carg at gmail dot com
The backslash namespace separator was introduced in 2008

Would it be possible to consider using dots inside strings. Eg:

namespace "my.package";
use "some.package.class";

How difficult would it be for the interpreter to parse this line of code? For me, it the most modern and clean solution. And it looks much better, doesn't it?

Expected result:
namespace "my.package";
use "some.package.class";

Actual result:
namespace my\package;
use some\package\class;


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-10-25 15:26 UTC]
-Status: Open +Status: Suspended
 [2016-10-25 15:26 UTC]
In my opion, it wouldn't make sense to introduce this syntax only
for namespace and use statements, but not for the general case.
The latter, however, would introduce several issues, e.g. that
someone might want to construct a qualified identifier dynamically
what would raise performance issues, if possible at all.

Anyhow, such a change would require an RFC[1]; therefore I'm
suspending this feature request.

[1] <>
 [2016-10-25 15:26 UTC]
-Summary: Proporse new namespace separator: dot inside a string +Summary: Propose new namespace separator: dot inside a string
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Dec 06 18:01:28 2023 UTC