PHP Methods static [duplicate]

2

PHP allows me to have static methods. The advantage is that you have them accessible without having to instantiate the class Documentation .

However, when it comes to static methods, I can use them both ways WITHIN YOUR CLASS :

class Teste
{
    private static metodoEstatico()
    {
        //código
    }

    public outroMetodo()
    {
        self::metodoEstatico(); 
        $this->metodoEstatico();
    }
}

PHP allows you to use static methods, both ways, within the class itself. Is there any difference in performance or something relevant to the two forms of use being within the class itself?

    
asked by anonymous 16.04.2018 / 20:06

0 answers