Reputation: 11
Possible Duplicates:
Calling non static method with "::"
Does static method in PHP have any difference with non-static method?
What is the reason for allowing calling non-static methods using ::, given we don't try to access anything inside the object context with $this? Is it a backward compatibility thing, or is it so for some particular reason? Should I get myself used to avoiding using :: to access non-static methods?
class Foo{
public function Bar(){
echo "this works just fine";
}
}
Foo::Bar();
Upvotes: 0
Views: 1407
Reputation: 1476
There are several reasons why someone might do this.
http://www.ibm.com/developerworks/library/os-php-designptrns/
Upvotes: -1