0
在文档http://www.php.net/manual/en/language.operators.precedence.php据说,++
和--
运算符具有很高的优先级。 但据我所知,++$x
和$x++
是不一样的。此外,$x++
应该有最小的优先级,因为一切都完成后其计算公式为:PHP post-increment/descrement运算符优先级
$x = 1;
var_dump(1 and $x--); // and operator is one of last operators in the table, it will be executed before post decrement
所以,后递增/递减运算应该在这个表中的底部?
这就是为什么我从来没有在任何语言编写这样的代码,无论是:) –
@佐尔坦 - 陶马希我是多么紧凑将要进行ZCE考试,所以我需要知道这一点。在现实生活中,普通人永远不会这样做:) – avasin