June 1999
Intermediate to advanced
540 pages
21h 39m
English
Expressions are combined and manipulated using operators. Table 16.2 shows the operators available in PHP, along with their precedence and associativity. The table lists the operators from highest to lowest precedence. These operators should be familiar to you if you have any C, Java, or Perl experience.
Table 16-2. PHP Operators
| Operators | Precedence | Associativity |
!, ~,
++, --, @ (the casting operators) | 16 | Right |
*, /, %
| 15 | Left |
+, -, .
| 14 | Left |
<<, >>
| 13 | Left |
<, <=, >=, >
| 12 | Nonassociative |
==, !=
| 11 | Nonassociative |
&
| 10 | Left |
^
| 9 | Left |
|
| 8 | Left |
&&
| 7 | Left |
||
| 6 | Left |
? : (conditional operator) | 5 | Left |
=, +=, -=, *=, /=, %=,
^=, .=, &=, |=
| 4 | Left |
And
| 3 | Left |
Xor
| 2 | Left |
Or
| 1 | Left |
Read now
Unlock full access