$foo::bar()- This is a call to a static method bar(), that is, the object was $foonot called by the method __construct().
When called, the $foo->bar()object $foomust be instructed before! Example:
$foo = new Foo;
echo $foo->bar();
Often you do not call a static method on an existing object, as in the example ( $foo), you can call it directly in the Foo class:
Foo::bar();
source
share