https://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php
The double colon is called the Scope Resolution Operator and is used to ” allows access to static, constant, and overridden properties or methods of a class.”
//Exemple 1
class MyClass {
const CONST_VALUE = 'A constant value';
}
$classname = 'MyClass';
echo $classname::CONST_VALUE; // As of PHP 5.3.0
echo MyClass::CONST_VALUE;
//Exemple 2
class OtherClass extends MyClass
{
public static $my_static = 'static var';
public static function doubleColon() {
echo parent::CONST_VALUE . "\n";
echo self::$my_static . "\n";
}
}
$classname = 'OtherClass';
$classname::doubleColon(); // As of PHP 5.3.0
OtherClass::doubleColon();