String :: and __ the double colon and double underscore in PHP
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
精彩评论