class function. Can we use return or echo interchangeable?
If you use return in any function inside class you can return String and it's same as echo but if you need to return an Integer or float you can't do that with echo, anyway if you print result with echo need in second step to parse it.
Return is the one you want in 99% of cases
You need to understand what functions are
Обсуждают сегодня