php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #70834 Namespace name scalar with ::namespace
Submitted: 2015-11-02 11:03 UTC Modified: 2015-11-02 11:04 UTC
From: office at maslosoft dot com Assigned:
Status: Open Package: Reflection related
PHP Version: Irrelevant OS: Any
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: office at maslosoft dot com
New email:
PHP Version: OS:

 

 [2015-11-02 11:03 UTC] office at maslosoft dot com
Description:
------------
Background:
There is existing special constant, ie `Vendor\Package\ClassName::class`, as per RFC:
https://wiki.php.net/rfc/class_name_scalars

Requested feature:
There could be also namespace constant, which is anyway reserved, ie:

`Vendor\Package\ClassName::namespace` should resolve to string '\Vendor\Package\ClassName'

Pros:
Could be used for any namespace related operation, like registering namespace for some purpose

Cons:
Could interfere with token parsing scripts



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-11-02 11:04 UTC] office at maslosoft dot com
Typo, it should be:
`Vendor\Package\ClassName::namespace` should resolve to string '\Vendor\Package'
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Dec 16 02:01:24 2019 UTC