List of Keywords

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.

PHP Keywords
__halt_compiler 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)
Compile-time constants
__CLASS__ __DIR__ (as of PHP 5.3) __FILE__ __FUNCTION__ __LINE__ __METHOD__
__NAMESPACE__ (as of PHP 5.3) __TRAIT__ (as of PHP 5.4)