WEB DEVELOPMENT

Coding Standards

Variable Naming Standards

There is no definitive naming convention in PHP, and they differ by framework:

So: Use whatever your framework uses or create your own naming convention.

At least for function names and class methods, there is a one thing to consider, but some frameworks discard it: PHP is case insensitive in that case, so aTonalFunction() atonalFunction() &?php &?= StudlyCaps UPPER_CASE camelCase namespace use abstract final static must be declared after the visibility.

  • Control structure keywords must have one space after them; method and function calls must not.

  • Opening braces for control structures must go on the same line, and closing braces must go on the next line after the body.

  • Opening parentheses for control structures must not have a space after them, and closing parentheses for control structures must not have a space before.