cvs: phpdoc /en/language operators.xml

From: Date: Sat, 13 Apr 2002 09:59:01 +0000
Subject: cvs: phpdoc /en/language operators.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969344355@lists.php.net to get a copy of this message
goba Sat Apr 13 05:59:01 2002 EDT Modified files: /phpdoc/en/language operators.xml Log: (double) is (float), moving precedence table to the more logical first place. Index: phpdoc/en/language/operators.xml diff -u phpdoc/en/language/operators.xml:1.32 phpdoc/en/language/operators.xml:1.33 --- phpdoc/en/language/operators.xml:1.32 Wed Feb 27 08:40:30 2002 +++ phpdoc/en/language/operators.xml Sat Apr 13 05:59:00 2002 @@ -1,10 +1,123 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.32 $ --> +<!-- $Revision: 1.33 $ --> <chapter id="language.operators"> <title>Operators</title> <simpara> </simpara> + <sect1 id="language.operators.precedence"> + <title>Operator Precedence</title> + <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 <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 + lowest-precedence operators listed first. + <table> + <title>Operator Precedence</title> + <tgroup cols="2"> + <thead> + <row> + <entry>Associativity</entry> + <entry>Operators</entry> + </row> + </thead> + <tbody> + <row> + <entry>left</entry> + <entry>,</entry> + </row> + <row> + <entry>left</entry> + <entry>or</entry> + </row> + <row> + <entry>left</entry> + <entry>xor</entry> + </row> + <row> + <entry>left</entry> + <entry>and</entry> + </row> + <row> + <entry>right</entry> + <entry>print</entry> + </row> + <row> + <entry>left</entry> + <entry> + = += -= *= /= .= %= &amp;= |= ^= ~= &lt;&lt;= &gt;&gt;= + </entry> + </row> + <row> + <entry>left</entry> + <entry>? :</entry> + </row> + <row> + <entry>left</entry> + <entry>||</entry> + </row> + <row> + <entry>left</entry> + <entry>&amp;&amp;</entry> + </row> + <row> + <entry>left</entry> + <entry>|</entry> + </row> + <row> + <entry>left</entry> + <entry>^</entry> + </row> + <row> + <entry>left</entry> + <entry>&amp;</entry> + </row> + <row> + <entry>non-associative</entry> + <entry>== != === !==</entry> + </row> + <row> + <entry>non-associative</entry> + <entry>&lt; &lt;= &gt; &gt;=</entry> + </row> + <row> + <entry>left</entry> + <entry>&lt;&lt; &gt;&gt;</entry> + </row> + <row> + <entry>left</entry> + <entry>+ - .</entry> + </row> + <row> + <entry>left</entry> + <entry>* / %</entry> + </row> + <row> + <entry>right</entry> + <entry>! ~ ++ -- (int) (float) (string) (array) (object) @</entry> + </row> + <row> + <entry>right</entry> + <entry>[</entry> + </row> + <row> + <entry>non-associative</entry> + <entry>new</entry> + </row> + </tbody> + </tgroup> + </table> + </para> + </sect1> + <sect1 id="language.operators.arithmetic"> <title>Arithmetic Operators</title> <simpara> @@ -495,119 +608,6 @@ <link linkend="language.operators.precedence">Operator Precedence</link>.) </simpara> - </sect1> - - <sect1 id="language.operators.precedence"> - <title>Operator Precedence</title> - <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 <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 - lowest-precedence operators listed first. - <table> - <title>Operator Precedence</title> - <tgroup cols="2"> - <thead> - <row> - <entry>Associativity</entry> - <entry>Operators</entry> - </row> - </thead> - <tbody> - <row> - <entry>left</entry> - <entry>,</entry> - </row> - <row> - <entry>left</entry> - <entry>or</entry> - </row> - <row> - <entry>left</entry> - <entry>xor</entry> - </row> - <row> - <entry>left</entry> - <entry>and</entry> - </row> - <row> - <entry>right</entry> - <entry>print</entry> - </row> - <row> - <entry>left</entry> - <entry> - = += -= *= /= .= %= &amp;= |= ^= ~= &lt;&lt;= &gt;&gt;= - </entry> - </row> - <row> - <entry>left</entry> - <entry>? :</entry> - </row> - <row> - <entry>left</entry> - <entry>||</entry> - </row> - <row> - <entry>left</entry> - <entry>&amp;&amp;</entry> - </row> - <row> - <entry>left</entry> - <entry>|</entry> - </row> - <row> - <entry>left</entry> - <entry>^</entry> - </row> - <row> - <entry>left</entry> - <entry>&amp;</entry> - </row> - <row> - <entry>non-associative</entry> - <entry>== != === !==</entry> - </row> - <row> - <entry>non-associative</entry> - <entry>&lt; &lt;= &gt; &gt;=</entry> - </row> - <row> - <entry>left</entry> - <entry>&lt;&lt; &gt;&gt;</entry> - </row> - <row> - <entry>left</entry> - <entry>+ - .</entry> - </row> - <row> - <entry>left</entry> - <entry>* / %</entry> - </row> - <row> - <entry>right</entry> - <entry>! ~ ++ -- (int) (double) (string) (array) (object) @</entry> - </row> - <row> - <entry>right</entry> - <entry>[</entry> - </row> - <row> - <entry>non-associative</entry> - <entry>new</entry> - </row> - </tbody> - </tgroup> - </table> - </para> </sect1> <sect1 id="language.operators.string">

« previous php.doc (#969344355) next »