Would not the return just be the same?
No !!!
The $idade--
subtracts 1
from the value of $idade
. Equivalent to:
$idade = $idade - 1;
So, if you remove the $idade--
, the value returned by your function will always be 1
more than it returns today.
If you want, you can even do both things on the same line, but then you would use --$idade
instead of $idade--
:
return --$idade;
This is because the --
at the end first returns the (current) value of the variable, and then decrements it. In the beginning, it first decrements and then returns. The same is true for the ++
(start or end) increment operators.