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()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…