CVS update: php3/doc/chapters
| From: | jim | Date: | Tue, 25 May 1999 01:32:33 +0000 |
| Subject: | CVS update: php3/doc/chapters | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-5965@lists.php.net to get a copy of this message | ||
Date: Monday May 24, 1999 @ 21:32
Author: jim
Update of /repository/php3/doc/chapters
In directory php:/tmp/cvs-serv31851
Modified Files:
lang-const.sgml
Log Message:
Add operator precedence table.
Index: php3/doc/chapters/lang-const.sgml
diff -u php3/doc/chapters/lang-const.sgml:1.39 php3/doc/chapters/lang-const.sgml:1.40
--- php3/doc/chapters/lang-const.sgml:1.39 Mon May 24 21:13:05 1999
+++ php3/doc/chapters/lang-const.sgml Mon May 24 21:32:32 1999
@@ -1592,8 +1592,110 @@
<symbol>expr1</symbol> evaluates to false.
<sect2 id="precedence">
- <title>Precedence</title>
- <simpara></simpara>
+ <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 16 and not
+ 18 because the multiplication ("*") operator has a higher precedence
+ than the addition ("+") operator.
+ <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>= += -= *= /= .= %= &= != ~= <<=
>>=</entry>
+ </row>
+ <row>
+ <entry>left</entry>
+ <entry>? :</entry>
+ </row>
+ <row>
+ <entry>left</entry>
+ <entry>||</entry>
+ </row>
+ <row>
+ <entry>left</entry>
+ <entry>&&</entry>
+ </row>
+ <row>
+ <entry>left</entry>
+ <entry>|</entry>
+ </row>
+ <row>
+ <entry>left</entry>
+ <entry>^</entry>
+ </row>
+ <row>
+ <entry>left</entry>
+ <entry>&</entry>
+ </row>
+ <row>
+ <entry>non-associative</entry>
+ <entry>== !=</entry>
+ </row>
+ <row>
+ <entry>non-associative</entry>
+ <entry>< <= > >=</entry>
+ </row>
+ <row>
+ <entry>left</entry>
+ <entry><< >></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>
<!-- Keep this comment at the end of the file
Local variables:
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net