Increment and Decrement Operators are common in many Languages,
Increment Operator is represented by
Decrement Operator is represented by
Pre-increment or Pre-decrement:
if you Put increment or Decrement Operator before the variable, operation is done to the variable first then the result is returned.
Post-increment or Post-decrement:
if you put increment or decrement operator after the variable, Operation is done after the variable returned.
++$a(Pre-increment) = Increments $a by one, then returns $a.
$a++(Post-increment) = Returns $a, then increments $a by one.
–$a(Pre-decrement) = Decrements $a by one, then returns $a.
$a–(Post-decrement) = Returns $a, then decrements $a by one.
I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.
I am Arjun from Hyderabad (India). I have been working as a software engineer from the last 7+ years, and it is my passion to learn new things and implement them as a practice. Aside from work, I like gardening and spending time with pets.