Clarifying operator precedence docs on meaning of non-associativity and how this affects operator parsing.

Fixes bug #63783


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@329164 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Sherif Ramadan 2013-01-16 15:56:24 +00:00
parent 336bf822a6
commit 95f54b87fd

View file

@ -213,7 +213,12 @@
<para>
For operators of equal precedence, left associativity means that
evaluation proceeds from left to right, and right associativity means
the opposite.
the opposite. For operators of equal precedence that are non-associative
those operators may not associate with themselves. So for example, the
statement <literal>1 &lt; 2 &gt; 1</literal>, is illegal in PHP. Whereas,
the statement <literal>1 &lt;= 1 == 1</literal> is not, because the
<constant>T_IS_EQUAL</constant> operator has lesser precedence than the
<constant>T_IS_SMALLER_OR_EQUAL</constant> operator.
<example>
<title>Associativity</title>
<programlisting role="php">