If you read http://php.net/manual/en/language.operators.increment.php you’ll see that the ++$num usage is called a "pre-increment, whereas $num++ is called “post-increment”. Post increment will increment the value after it is used for the expression. In this case, it is incremented after you echo it.
Mittineague, In the first one - Xdebugger error. The second one did work… I did got 11… But I must say it’s very interesting to me to understand why for someone else it worked when I wrote it as I displayed in the original post…
Oh sorry, I missed this echo and mistakenly thought each one of the two was a call, maybe because in JS I putted it in the same place (at least in loops) and I confused it with the way it works in PHP - I guess the shortest way for me is to write it from before, i.e ++$num… This is the most minimal way I have in PHP.
I often have trouble with video tutorials. They tend to go faster than my eyes can see and brain can absorb.
A “4 minute” video can take me closer to 15 minutes what with all the pausing and rewinding.
Not to say they aren’t any good, many like learning from them. Just that I do better with something that I can move along at my own pace.