Identifiers PHP

Identifiers give names to the abstract parts of PHP: functions, variables, and classes. Some of them are created by PHP in the form of built-in functions or environment variables. Others you create. Identifiers may be of any length and can consists of letters, numbers, or underscores. The first character of an identifier must be either a letter or an underscore. Table contrasts acceptable identifiers with unacceptable ones.

Upper- and lowercase letters are recognized as different. That is, the variables UserName and username are two distinct identifiers. The exception is built-in functions.


Variables, discussed in detail below, are always preceded by $. The side effect of this is that a function and a variable can share a name. You may also create a variable with the same name as a built-in function. Consider that this can be very confusing to anyone reading your code, including you. You may never create a function with the same name as a built-in function.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

PHP Topics