|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #73802 Operator Precedence
Submitted: 2016-12-21 18:59 UTC Modified: 2016-12-22 01:07 UTC
From: alexwerser at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 7.0.14 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: alexwerser at gmail dot com
New email:
PHP Version: OS:


 [2016-12-21 18:59 UTC] alexwerser at gmail dot com
On page indicates that the operator ** is of higher priority than ++ -- ~ (int) (float) (string) (array) (object ) (bool) @, but it is not.

Test script:
// this script returns 9 instead of 15
echo --$a**2;


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-22 01:07 UTC]
-Status: Open +Status: Not a bug
 [2016-12-22 01:07 UTC]
The issue is that --($a ** 2) is not a valid expression. Thus the parser parses it the only possible way: (--$a) ** 2.

And the manual is therefore still correct.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Nov 26 04:01:23 2020 UTC