4
In PHP, what do these four dots mean "::" ?
I see a lot in things like: stackoverflow::class
4
In PHP, what do these four dots mean "::" ?
I see a lot in things like: stackoverflow::class
9
These four dots mean that you are calling a static method a class. A static method can be called without the need to instantiate a class object. 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 about static methods you can read in the official documentation: http://php.net/manual/en/language.oop5.static.php
Browser other questions tagged php mvc tags
You are not signed in. Login or sign up in order to post.
Got it, too much dough! Thanks.
– user80010