Doc #73802 [Opn->Nab]: Operator Precedence

From: Date: Thu, 22 Dec 2016 01:07:05 +0000
Subject: Doc #73802 [Opn->Nab]: Operator Precedence
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-14287@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73802&edit=1 ID: 73802 Updated by: bwoebi@php.net Reported by: alexwerser at gmail dot com Summary: Operator Precedence -Status: Open +Status: Not a bug Type: Documentation Problem Package: Documentation problem PHP Version: 7.0.14 Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2016-12-21 18:59:31] alexwerser at gmail dot com Description: ------------ On page http://php.net/manual/en/language.operators.precedence.php 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 $a=4; echo --$a**2; ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73802&edit=1

« previous php.doc.bugs (#14287) next »