My stream of consciousness being a programmer.

Wednesday, December 21, 2011

PHP Incrementing & Decrementing Operators


Image result for plus and minus

What is the meaning of ++ increment operator and - – decrement operator and how can we use it ?

Below is a small explanation on what it does,

++$a means Pre-increment, It increments $a by one, then returns $a.

$a++ means Post-increment, It returns $a, then increments $a by one.

- – $a means Pre-decrement, It decrements $a by one, then returns $a.

$a – - means Post-decrement, It returns $a, then decrements $a by one.

21 Dec 2011

Related Posts:

  • No CHECK Constraint in MYSQL It looks like MYSQL doesn’t really validate for check constraint. I checked for mysql manual and noticed its true. Copied the following section fr… Read More
  • PHP has no FINALLY I am so curious why PHP doesn’t have FINALLY block along with normal TRY CATCH blocks. It’s very much necessary and will let us stay away from code … Read More
  • CRUD application with Yii framework. Please note that, this is a very minimal sample application done for a USER model using yii framework. How to run, 1 – Please download the attach… Read More
  • MYSQL Table locking his topic can be new to some but its very much important when working with concurrent access to a particular table row (record). for example lets s… Read More
  • PHP Incrementing & Decrementing Operators What is the meaning of ++ increment operator and - – decrement operator and how can we use it ? Below is a small explanation on what it does, ++… Read More

0 comments:

Post a Comment

Popular Posts

Powered by Blogger.