Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Operator Precedence table

Mon Oct 27, 2008 4:34 pm

Code:
<?php

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




Post a reply
  Related Posts  to : Operator Precedence table
 precedence and associativity     -  
 Using the ? Operator     -  
 What is the % operator     -  
 operator int()     -  
 What is Operator Overloading? !!!     -  
 Sizeof Operator     -  
 Object without new Operator     -  
 stream operator     -  
 operator overloading     -  
 trinary operator     -  

Topic Tags

PHP Basics