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