$a = 5;
$a++; // $a has been incremented by 1, and now equals 6
$a--; // $a has been decremented by 1, and now equals 5
$b = 5 * $a++; // Note that the incrementing happens after the evaluation:
// First, $b is calculated to be 25. Then, $a is
// incremented to become 6
//
// If you want $a to be incremented first, put the ++ in front of it
// as follows:
$b = 5 * ++$a; // $a incremented to 7; $b becomes 35
$c = 100;
$c -= ++$b + $a++; // $b becomes 36; $c is calculated to be
// 100 - ( 36 + 7 ); finally, $a becomes 8
|