mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 17:08:54 +00:00
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:
parent
4c54df29c0
commit
e598de1dc9
1 changed files with 8 additions and 5 deletions
|
@ -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 . "<br>\n";
|
|||
<row>
|
||||
<entry>left</entry>
|
||||
<entry>
|
||||
= += -= *= /= .= %= &= |= ^= ~= <<= >>=
|
||||
</entry>
|
||||
= += -= *= /= .= %= &= |= ^= ~= <<= >>=
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>left</entry>
|
||||
|
|
Loading…
Reference in a new issue