PHP basic syntax: self-increment and self-decrement

Self-adding and self-subtracting operations

Self-adding and self-subtracting means adding 1 to yourself or subtracting 1 from yourself.
If you have studied other programming languages. You will find that the usage here is another rule in the computer. It can be used like this, which makes it more concise.

##$x++ First Add #$x after assignment-- Assign value first and then subtract ++$x Add first and then assign value --$x Decrease first and then assign value
Symbol Description
The above usage is actually quite simple Yes, follow the example above. We divide it into steps and judge according to the process.

Let’s compare adding first and then assigning value, as follows:

You can do another experiment and try $x-- and --$x. Is this the result?

Please answer, what is the result of $water + $paper below?


Continuing Learning
||
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!