class Foo {

    private $color;

    public function bar() {
        echo 'before';
        $this->color = "blue";
        echo 'after';
    }
}

// Foo::bar();  

// Deprecated
$obj = new Foo;
$obj::bar();
Deprecated:
Non-static method Foo::bar() should not be called statically
php.net:
In PHP 7, calling non-static methods statically is deprecated, and will generate an E_DEPRECATED warning. Support for calling non-static methods statically may be removed in the future
by Valeri Tandilashvili
4 years ago
PHP
OOP
PHP official doc
2
Pro tip: use ```triple backticks around text``` to write in code fences