|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67773 Scope-Resolution Operator
Submitted: 2014-08-05 16:56 UTC Modified: 2015-06-28 21:37 UTC
From: Assigned: stas (profile)
Status: Closed Package: PHP Language Specification
PHP Version: Irrelevant 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:
New email:
PHP Version: OS:


 [2014-08-05 16:56 UTC]

This section makes it sound like class constants and methods and static properties all live in the same namespace (which is wrong, they have distinct namespaces and you can have a method and a class constant with the same name). Also, nothing in this section, other sections, or the syntax rules give enough information allow the reader to distinguish between a ::-style method call expression, a constant access, and a static property access. This is key to describing how a parsed expression involving the :: operator is interpreted by the engine. For example does "C::$x" access a static property of class C named 'x', or does it access a class constant whose name is held in local variable $x? Does "C::$x()" call a method on class C whose name is held in local variable $x, or does it call a callback stored in static property of class C named 'x'? Finally, this section doesn't describe how ::-style method lookup or static property lookup or class constant lookup. For example if there is are multiple static properties named 'x' (possibly with different public/protected/private modifiers), how do we decide which one gets accessed. Same goes for methods. 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-28 21:24 UTC]
I'm sorry but I don't see where the language implies properties and methods live in the same namespace (the language may have changed since the report, so maybe it's fixed already). I'll add the language making it more clear when :: is used for constants, properties and methods.
 [2015-06-28 21:37 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: stas
 [2015-06-28 21:37 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 01 12:01:29 2024 UTC