Saturday, November 1, 2008

Identifiers

An identifier is a general term applied to variables, functions, and various other user-defined objects. There are several properties that PHP identifiers must abide by:
An identifier can consist of one or more characters and must begin with an
alphabetical letter or an underscore
. Furthermore, identifiers can only consist
of letters, numbers, underscore characters, and other ASCII characters
from 127 through 255. Consider a few examples:
VALID INVALID
my_function This&that
Size !counter
_someword 4ward
Identifiers are case sensitive. Therefore, a variable named $recipe is different
from variables named $Recipe, $rEciPe, or $recipE.
Identifiers can be any length. This is advantageous, as it enables a programmer
to accurately describe the identifier’s purpose via the identifier name.
Finally, an identifier name can’t be identical to any of PHP’s predefined keywords.

No comments: