13

Possible Duplicate:
what is the “::” notation in php used for?

I noticed this code while modifying a friends code and noticed this piece of code: TestPages::LoadMenu();

what does :: mean in php?

A great answer would mean a lot.

Thanks!

Community
  • 1
  • 1
PinoyStackOverflower
  • 4,996
  • 14
  • 53
  • 121
  • 5
    Please go back and accept the best answers to your questions (i.e. click the big check mark to the left of the best answers). It will give you +2 rep for each one that you mark and generally improve the information on this site. It's the right thing to do. Do it. – FishBasketGordo Aug 05 '11 at 15:01
  • dublicate of http://stackoverflow.com/questions/3737139/reference-what-does-this-symbol-mean-in-php – RiaD Aug 05 '11 at 17:53

5 Answers5

21

It's the 'Scope Resolution Operator'.

The Scope Resolution Operator (also called Paamayim Nekudotayim) or in simpler terms, the double colon, is a token that allows access to static, constant, and overridden properties or methods of a class.

http://php.net/manual/en/language.oop5.paamayim-nekudotayim.php

Dogbert
  • 200,802
  • 40
  • 378
  • 386
10

In layman terms it is used to call static Methods of a Class.

In your example, LoadMenu() is a static function of the TestPages class.

This means that you do not have to create an instance of a TestPages to call LoadMenu()

jondavidjohn
  • 60,871
  • 21
  • 115
  • 157
5

It is used to access static methods of class, static variables and constants

Read more

RiaD
  • 45,211
  • 10
  • 74
  • 119
3

It means static class member access, in this case static method invocation.

vartec
  • 125,354
  • 36
  • 211
  • 241
1

It's used to access class methods / properties:

http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php

James
  • 11,844
  • 1
  • 16
  • 19
  • 1
    An important distinction to make to those that see this answer in the future, is that it is used to reference ***`static`*** members of a class, not an instantiated object's members. – jondavidjohn Aug 05 '11 at 17:48