diff --git a/language/operators.xml b/language/operators.xml
index 95d06825f9..9d3eac6d9b 100644
--- a/language/operators.xml
+++ b/language/operators.xml
@@ -43,15 +43,29 @@
18.
- When operators have equal precedence, their associativity decides
- whether they are evaluated starting from the right, or starting from
- the left - see the examples below.
+ When operators have equal precedence their associativity decides
+ how the operators are grouped. For example "-" is left-associative, so
+ 1 - 2 - 3 is grouped as (1 - 2) - 3
+ and evaluates to -4. "=" on the other hand is
+ right-associative, so $a = $b = $c is grouped as
+ $a = ($b = $c).
+
+
+ Operators of equal precedence that are non-associative cannot be used
+ next to each other, for example 1 < 2 > 1 is
+ illegal in PHP. The expression 1 <= 1 == 1 on the
+ other hand is legal, because the == operator has lesser
+ precedence than the <= operator.
+
+
+ Use of parentheses, even when not strictly necessary, can often increase
+ readability of the code by making grouping explicit rather than relying
+ on the implicit operator precedence and associativity.
The following table lists the operators in order of precedence, with
the highest-precedence ones at the top. Operators on the same line
- have equal precedence, in which case associativity decides the order
- of evaluation.
+ have equal precedence, in which case associativity decides grouping.
Operator Precedence
@@ -211,14 +225,6 @@
- For operators of equal precedence, left associativity means that
- evaluation proceeds from left to right, and right associativity means
- the opposite. For operators of equal precedence that are non-associative
- those operators may not associate with themselves. So for example, the
- statement 1 < 2 > 1, is illegal in PHP. Whereas,
- the statement 1 <= 1 == 1 is not, because the
- T_IS_EQUAL operator has lesser precedence than the
- T_IS_SMALLER_OR_EQUAL operator.
Associativity
@@ -239,8 +245,27 @@ echo ++$a + $a++; // may print 4 or 5
]]>
- Use of parentheses, even when not strictly necessary, can often increase
- readability of the code.
+
+
+ Operator precedence and associativity only determine how expressions
+ are grouped, they do not specify an order of evaluation. PHP does not
+ (in the general case) specify in which order an expression is evaluated
+ and code that assumes a specific order of evaluation should be avoided,
+ because it can change between versions of PHP without further notice.
+
+ Undefined order of evaluation
+
+
+]]>
+
+