开发者

What does :: mean in php? [duplicate]

This question already has answers here: 开发者_如何学Python Closed 11 years ago.

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!


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


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()


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

Read more


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


It's used to access class methods / properties:

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜