H I O X INDIA
Online PHP Tutorial
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Templates 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)
Español Français 中文 Deutsch
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

PHP Topics
Introduction
Syntax
Data Types
Variables
Operators
Control Structures
Functions
Pre-defined Function
Calendar Functions
Date and Time
Array Functions
Array Functions List1
Array Functions List2
Math Functions
PHP Mysql Functions
File Handling
Error Handling
DB Size
PHP Mail
String Tokens
String Functions
String Functions List1
String Functions List2
Session Functions
Cookies Functions
Form Variables
Running PHP from JS
Array To JS
Array to PHP
Encryption
Common Header
Ask Your Doubts
More about PHP
Feedback




PHP Operator Precedence


Topic

What is Operator Precedence?



Explanation

The precedence of an operator is important to bind two expressions together. For example, in the expression 1 + 5 * 3, the answer is 16 and not 18 because the "*" operator has a higher precedence than the "+" operator.

Parentheses may be used to force precedence, if necessary. For instance: (1 + 5) * 3 evaluates to 18. If operator precedence is equal, left to right associativity is used.

The following table lists the precedence of operators with the highest-precedence operators listed at the top of the table.

Associativity Operators Additional Information
non-associative clone new clone and new
left [ array()
non-associative ++ -- increment/decrement
non-associative ~ - (int) (float) (string) (array) (object) (bool) @ types
non-associative instanceof types
right ! Logical
left * / % arithmetic
left + - . arithmetic and string
left << >> bitwise
non-associative < <= > >= <> comparison
non-associative == != === !== comparison
left & bitwise and references
left bitwise
left | bitwise
left && logical
left || logical
left ? : ternary
right = += -= *= /= .= %= &= |= = <<= >>= assignment
left and logical
left xor logical
left or logical
left , many uses

Left associativity means that the expression is evaluated from left to right, right associativity means from right to left.





privacypolicy     licence     sitemap
(c) copyright, 2004 hioxindia.com