Interview Questions

What’s the difference between accessing a class method via -> and via ::?

PHP Interview Questions and Answers


(Continued from previous question...)

What’s the difference between accessing a class method via -> and via ::?

:: is allowed to access methods that can perform static operations, i.e. those, which do not require object initialization.

(Continued on next question...)

Other Interview Questions