开发者

String :: and __ the double colon and double underscore in PHP

开发者 https://www.devze.com 2023-01-02 10:33 出处:网络
Wh开发者_如何学编程at do you call with these string :: and __ in PHP and what other strings are similar to them?:: = Scope resolution operator: http://www.php.net/manual/en/language.oop5.paamayim-neku

Wh开发者_如何学编程at do you call with these string :: and __ in PHP and what other strings are similar to them?


:: = Scope resolution operator: http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php

The __-prefix is a convention surrounded by built-in magic: http://www.php.net/manual/en/userlandnaming.rules.php, never start a function or variable with this if you can avoid it.

The first is a token, the second a convention.

If you really want to know most tokens, see: http://www.php.net/manual/en/tokens.php If you want to know more about naming conventions, see: http://www.php.net/manual/en/userlandnaming.php

When starting out with PHP it would hurt to read Zend coding conventions, although it's not a must and not the only way by a long shot: http://framework.zend.com/manual/en/coding-standard.html

0

精彩评论

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