For example this:
var a = 123; var b = a++;
now a contains 124 and b contains 123
a
124
b
123
This is the standard way of doing it. The postincrement operator assigns the value and then increments.
The preincrement (++a) operator increments and then assigns.
++a
I am not familiar with php and cannot say how it does it or why.