views:

103

answers:

2

I don't know what its doing when we have this situation

Foo::Bar

It looks like a path

+6  A: 

The :: operator is the scope resolution operator. It is used to access class constants or static properties and methods, either from outside the class:

ClassName::CONSTANT_VALUE
ClassName::staticMethod()

Or within a class method to reference the same or a parent class using self and parent:

self::CONSTANT_VALUE
self::staticMethod()
parent::CONSTANT_VALUE
parent::staticMethod()
Gumbo
+8  A: 

That's (generally) for accessing a static method or property in a class. It's called the scope resolution operator, or Paamayim Nekudotayim (which leads to some amazingly confusing error messages!). See http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php.

Chris Smith
You beat me to it ;) Removed my answer as duplicate post.
Jan Kuboschek
+1 those error messages always have me looking twice
Thomas Winsnes
As the PHP manual page above notes, it means "double colon" Hebrew. Wikipedia mentions it, too. http://en.wikipedia.org/wiki/Scope_resolution_operator#PHP
David Weinraub