O'Reilly logo

Core PHP Programming, Third Edition by Leon Atkinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required