Liste der Schlüsselworte

Die folgenden Begriffe haben in PHP eine spezielle Bedeutung. Einige von ihnen sehen aus wie Funktionen, Konstanten usw., in Wirklichkeit handelt es sich aber um Sprachkonstrukte. Keines der folgenden Worte kann als Name für eine benutzerdefinierte Konstante, Klasse, Funktion oder Methode genutzt werden. Die Nutzung als Variablenname ist in der Regel möglich, sollte aber unterlassen werden um Verwirrung zu vermeiden.

PHP Schlüsselworte
__halt_compiler abstract (ab PHP 5) 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 (ab PHP 5.3) if implements include
include_once instanceof insteadof (as of PHP 5.4) interface isset
list namespace (ab 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
Konstanten zur Kompilierzeit
__CLASS__ __DIR__ (ab PHP 5.3) __FILE__ __FUNCTION__ __LINE__ __METHOD__
__NAMESPACE__ (ab PHP 5.3) __TRAIT__ (ab PHP 5.4)