Scope Resolution Operator ::

I have model class MyModel. I have some questions about Scope Resolution Operator.

  1. When I use MyModel::someMethod(), will it create instance of MyModel class?

  2. Will it create instance of MyModel class, if someMethod() declared as static?

  3. When I use MyModel::MY_CONST, will it create instance of MyModel class?

The short answer is: no, it won’t instantiate your class.

See the details here:

http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php

and here:

http://www.php.net/manual/en/language.oop5.static.php