php Identifiers

Identifier is a general term applied to variables, functions, and various other userdefined objects. There are several properties that PHP identifiers must abide by:

  • An identifier can consist of one or more characters and must begin with a letter or an underscore. Furthermore, identifiers can consist of only letters, numbers,underscore characters, and other ASCII characters from 127 through 255.
  • Valid Invalid
    my_function This&that
    Size !counter
    _someword 4ward
  • Identifiers are case sensitive. Therefore, a variable named $recipe is different from a variable named $Recipe, $rEciPe, or $recipE
  • Identifiers can be any length. This is advantageous because it enables a programmer to accurately describe the identifier's purpose via the identifier name
  • An identifier name can't be identical to any of PHP's predefined keywords. You can find a complete list of these keywords in the PHP manual appendix.




Content