The following list gives an overview of what rights the PHP project reserves itself when choosing names for new internal identifiers. Note that the definitive guide is the official CODING STANDARDS:
PHP owns the top-level namespace but tries to find decent descriptive names and avoid any obvious clashes.
Function names use underscores between words, while class names use the lower bumpy camel rule (there are some exceptions for older classes and functions).
PHP will prefix any global symbols of an extension with the name of the extension (note that in the past there have been numerous exceptions to this rule). Examples:
PREG_SPLIT_DELIM_CAPTURE
new DOMDocument()
strpos() (example of a past mistake)
new SplFileObject()
Iterators and Exceptions are however simply postfixed with "Iterator" and "Exception". Examples:
ArrayIterator
LogicException
PHP reserves all function names starting with __ as magical. It is recommended that you do not use function names with __ in PHP unless you want some documented magic functionality. Examples:
__get()
__autoload()
| Précédent | Sommaire | Suivant |
| Userland Naming Guide | Niveau supérieur | Tips |