Php – What do two colons mean in PHP

PHPzend-framework

I don't know what it's doing when we have this situation:

Foo::Bar

It looks like a path.

Best Answer

The :: operator is the scope resolution operator. It is used to access class constants or static properties and methods, either from outside the class:

ClassName::CONSTANT_VALUE
ClassName::staticMethod()

Or within a class method to reference the same or a parent class using self and parent:

self::CONSTANT_VALUE
self::staticMethod()
parent::CONSTANT_VALUE
parent::staticMethod()