These words have special meaning in PHP. Some of them represent things which look like functions, some look like constants, and so on - but they're not, really: they are language constructs. You cannot use any of the following words as constants, class names, function or method names. Using them as variable names is generally OK, but could lead to confusion.
abstract and array() as break callable (as of PHP 5.4) case catch class clone const continue declare default die() do echo else elseif empty() enddeclare endfor endforeach endif endswitch endwhile eval() exit() extends final finally (as of PHP 5.5) for foreach function global goto (as of PHP 5.3) if implements include include_once instanceof insteadof (as of PHP 5.4) interface isset() list() namespace (as of PHP 5.3) new or print private protected public require require_once return static switch throw trait (as of PHP 5.4) try unset() use var while xor yield (as of PHP 5.5)
__DIR__ (as of PHP 5.3)
__NAMESPACE__ (as of PHP 5.3)
__TRAIT__ (as of PHP 5.4)
Predefined Classes ¶
This section lists standard predefined classes. Miscellaneous extensions define other classes which are described in their reference.
Standard Defined Classes ¶
These classes are defined in the standard set of functions included in the PHP build.
Created by dir(). stdClass Created by typecasting to object.
Possibly created by unserialize().
Predefined classes as of PHP 5 ¶
These additional predefined classes were introduced in PHP 5.0.0.
Available since PHP 5.1.0. php_user_filter Closure ¶
The predefined final class Closure was introduced in PHP 5.3.0. It is used for representinganonymous functions.
For more information, see its class page.
The predefined final class Generator was introduced in PHP 5.5.0. It is used for