Noted that parentheses may be used to force precedence.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@31242 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Torben Wilson 2000-08-26 04:06:41 +00:00
parent 4c54df29c0
commit e598de1dc9

View file

@ -439,9 +439,12 @@ echo "Should be 4: " . $a . "<br>\n";
<para>
The precedence of an operator specifies how "tightly" it binds two
expressions together. For example, in the expression <literal>1 +
5 * 3</literal>, the answer is 16 and not 18 because the
multiplication ("*") operator has a higher precedence than the
addition ("+") operator.
5 * 3</literal>, the answer is <literal>16</literal> and not
<literal>18</literal> because the multiplication ("*") operator
has a higher precedence than the addition ("+") operator.
Parentheses may be used to force precedence, if necessary. For
instance: <literal>(1 + 5) * 3</literal> evaluates to
<literal>18</literal>.
</para>
<para>
The following table lists the precedence of operators with the
@ -479,8 +482,8 @@ echo "Should be 4: " . $a . "&lt;br&gt;\n";
<row>
<entry>left</entry>
<entry>
= += -= *= /= .= %= &amp;= |= ^= ~= &lt;&lt;= &gt;&gt;=
</entry>
= += -= *= /= .= %= &amp;= |= ^= ~= &lt;&lt;= &gt;&gt;=
</entry>
</row>
<row>
<entry>left</entry>