What is the purpose of the two double points (:)? [duplicate]

3

I see in some classes something like the following:

Illustrative class

class Carro
{
    private static $quantidade = 5;

    public function getQuantidade()
    {
        return self::$quantidade;
    }

    public function comprar()
    {

        self::$quantidade--;
    }
}

What I want to know is the following, the self operator calls the variable using two points: self:: . After all, what is this type of call for? Why was it used this way and not using the $this = > $this->$quantidade ?

    
asked by anonymous 06.07.2018 / 15:27

0 answers