tags:

views:

119

answers:

1

What do you call with these string :: and __ in PHP and what other strings are similar to them?

+1  A: 

:: = 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

Wrikken
How about the two $$?I saw it on some codes $$var;
kim edgard
Variable variable: http://www.php.net/manual/en/language.variables.variable.php Most often used by people who don't know how to use arrays. In about 95% of cases an array would server better then a $$varname.
Wrikken