In PHP, what do these four dots mean? ::?
I see a lot on things like: stackOverflow :: class
In PHP, what do these four dots mean? ::?
I see a lot on things like: stackOverflow :: class
These four dots mean that you are calling a static method of a class. A static method can be called without the need to instantiate an object of the class. Ex:
Class teste() {
public function metodoTradicional() {
echo 'Tradicional';
}
public static function metodoEstatico() {
echo 'Estático';
}
}
teste::metodoTradicional(); // vai dar erro
teste::metodoEstatico(); // vai imprimir 'Estático'
More on static methods you can read in the official documentation: link