Operators in PHP


Prev Tutorial Next Tutorial

Operators in PHP

Operators is a symbol which is used to perform operations on operands. Here you can see very simple example of operator

Example

$num=4+5;

In the above example, + is the binary + operator, 4 and 5 are operands and $num is variable.

PHP divides the operators in the following groups:

  • Arithmetic Operators
  • Comparison Operators
  • Bitwise Operators
  • Logical Operators
  • String Operators
  • Incrementing/Decrementing Operators
  • Array Operators
  • Assignment Operators

Operators in php

OperatorsAdditional InformationAssociativity
clone newclone and newnon-associative
[array()left
**arithmeticright
++ -- ~ (int) (float) (string) (array) (object) (bool) @increment/decrement and typesright
instanceoftypesnon-associative
!logical (negation)right
* / %arithmeticleft
+ - .arithmetic and string concatenationleft
<< >>bitwise (shift)left
< <= > >=comparisonnon-associative
== != === !== <>comparisonnon-associative
&bitwise ANDleft
^bitwise XORleft
|bitwise ORleft
&&logical ANDleft
||logical ORleft
?:ternaryleft
= += -= *= **= /= .= %= &= |= ^= <<= >>= =>assignmentright
andlogicalleft
xorlogicalleft
orlogicalleft
,many uses (comma)left

Prev Tutorial Next Tutorial

Google Advertisements
Download Projects

Google Adsense Advertisements

Buy 3 Year Old Domain, Tutorialday.com, SeosmoTools.com @$200

Buy This Ad Space @$50 per Month, Ad Size 300X250 Contact on: hitesh.xc@gmail.com WhatsApp no. 8882538826

Yahoo Advertisements