|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
6 + 13 = ?
Subscribe to this entry?

 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 22 04:01:29 2024 UTC