Knowing that the naming convention is a set of standards and rules for writing names, source code, identifiers and comments within programming, which make it easier and more understandable to read...
What are the most used naming conventions in PHP?
Note: This is an auto-response, intended to serve as a point of reference when choosing a naming convention in the PHP language.
With respect to the naming convention, it must be taken into account that many naming conventions use upper and lower case letters in their identifiers. This use varies according to the type of element to be identified.
Among them we have:
1.
PascalCase
The first letter of the identifier and the first letter of the following concatenated words are capitalized. The Pascal case style can be used on identifiers of three or more characters, for example:
MiClase
two.
camelCase
The first letter of the identifier is lowercase and the first letter of the following concatenated words is uppercase, for example:
unaPropiedad
3.
ALL_CAPS
All letters in the identifier are capitalized and words are separated by an underscore
_
. ExampleUNA_CONSTANTE
Four.
small_caps
All the letters of the identifier are in lowercase and the words are separated by
_
. Example:una_funcion
5.
Proper_Case
Like CamelCase, but each word start separated by a
_
. It is used very little.This table shows the main naming conventions for the different program elements in PHP.
It was originally posted here .: