The following list gives an overview of which rights the PHP project reserves for itself, when choosing names for new internal identifiers. The definitive guide is the official » PHP 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, class names use
PascalCase, and method names use
camelCase.
PHP will prefix any global symbols of an extension with the name of the extension. (In the past, there have been numerous exceptions to this rule, so some existing names are not prefixed.) 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:
PHP reserves all symbols starting with __
as magical. It is recommended not to create symbols starting with
__ in PHP, unless the intent is to use documented
magical functionality. Examples: