Operator Precedence summary table : Operator Precedence « Operator « PHP






Operator Precedence summary table



Operator                Class                 Associativity

new                     Unary                 n/a

[                       Unary                 Right

!                       Unary                 ! and ~ are right associative;
~                                             ++ and-- operators are right or left associative
++ 
-- 
(int) 
(double) 
(string) 
(array) 
(object)
 @
-------------------------------------------------------------------------------------  
* / %                  Binary                 Left

+ - .                  Binary                 Left

<< >>                  Binary                 Left

< <= > >=              Binary                 n/a

== != === !==          Binary                 n/a

&                      Binary                 Left

^                      Binary                 Left

|                      Binary                 Left

&&                     Binary                 Left

||                     Binary                 Left

?:                     Ternary                Left

=                      Binary                 Left
+= 
-= 
*= 
/= 
.= 
%= 
&= 
|= 
^= 
~= 
<<= 
>>=
  
print                 Unary                    Right

and                   Binary                   Left

xor                   Binary                   Left

or                    Binary                   Left

,                     n/a                      Left
           
       








Related examples in the same category

1.Operator Precedence
2.Operators, precedence, and their associativity
3.Using the ? Operator
4.Using the ? operator to create a message