|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #64270 Operator precedence table incomplete
Submitted: 2013-02-21 20:29 UTC Modified: 2013-02-27 04:27 UTC
From: phpbugs at geniusdex dot net Assigned:
Status: Wont fix Package: Documentation problem
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:
From: phpbugs at geniusdex dot net
New email:
PHP Version: OS:


 [2013-02-21 20:29 UTC] phpbugs at geniusdex dot net
The table in the documentation containing the operator precedence is incomplete; see .

For example, the object operator (->), the scope resolution operator (::) and the namespace operator (\) are not included in the table.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-02-27 04:27 UTC]
The mentioned operators are not the same "sort" of operators as those listed in 
the operator precedence table. It would not provide any benefit to list them 
there, as they have ultimate precedence in any statement, and no combination of 
them is both valid and ambiguous.
 [2013-02-27 04:27 UTC]
-Status: Open +Status: Wont fix
 [2014-02-25 04:16 UTC] reinard at reinard dot com
I feel that it's actually important to know whether :: or -> has higher precedence. consider:


Am I resolving the namespace first on $object or am I looking for a $object in the current context and attempt to call it's method() first?

or what about a static method in the above example?


which scope gets resolved first?

Even though the "incorrect" interpretation would probably result in parser errors, there would be no harm in clarifying this for users.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 26 09:01:32 2024 UTC