• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 16. PHP > Operators

16.7. Operators

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
OperatorsPrecedenceAssociativity
!, ~, ++, --, @ (the casting operators)16Right
*, /, %15Left
+, -, .14Left
<<, >>13Left
<, <=, >=, >12Nonassociative
==, !=11Nonassociative
&10Left
^9Left
|8Left
&&7Left
||6Left
? : (conditional operator)5Left
=, +=, -=, *=, /=, %=, ^=, .=, &=, |=4Left
And3Left
Xor2Left
Or1Left



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint