PHP Pocket Reference, 2nd Edition (2009)
Operators
Expressions are combined and manipulated using operators. The following table lists the operators from highest to lowest precedence; the second column (A) shows the operators' associativity. These operators should be familiar to you if you have any C, Java, or Perl experience.
|
Operators |
A |
|
!, ~, ++, --, @, (the casting operators) |
Right |
|
*, /, % |
Left |
|
+, -, . |
Left |
|
<<, >> |
Left |
|
<, <=, >=, > |
Nonassociative |
|
==, !=, ===, !== |
Nonassociative |
|
& |
Left |
|
^ |
Left |
|
| |
Left |
|
&& |
Left |
|
|| |
Left |
|
? : (conditional operator) |
Left |
|
=, +=, -=, *=, /=, %=, ^=, .=, &=, |=, <<=, >>= |
Left |
|
AND |
Left |
|
XOR |
Left |
|
OR |
Left |
All materials on the site are licensed Creative Commons Attribution-Sharealike 3.0 Unported CC BY-SA 3.0 & GNU Free Documentation License (GFDL)
If you are the copyright holder of any material contained on our site and intend to remove it, please contact our site administrator for approval.
© 2016-2026 All site design rights belong to S.Y.A.