Appendix C. Operators

PrecedenceOperatorOperation It PerformsAssociativity
1!logical notRight
 ~bitwise not 
 ++Increment 
 --decrement 
 @silence operator 
 (int)integer cast 
 (float)floating-point cast 
 (string)string cast 
 (bool)boolean cast 
 (array)array cast 
 (object)object cast 
2*multiplyLeft
 /divide 
 %modulo 
3+addLeft
 subtract 
 .concatenate 
4<<bitwise shift leftLeft
 >>bitwise shift right 
5<is smallerNonassociative
 <=is smaller or equal 
 >is greater 
 >=is greater or equal 
6==is equalNonassociative
 !=is not equal 
 ===is identical 
 !==is not identical 
7&&logical andLeft
8||logical orLeft
9? :question mark operatorLeft
10=assignRight
 =&assign by reference 
 +=assign add 
 -=assign subtract 
 *=assign multiply 
 /=assign divide 
 %=assign modulo 
 ^=assign ...

Get Core PHP Programming, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.