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
+ 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.
@@ -27,7 +27,10 @@
- abstract (as of PHP 5)
+ __halt_compiler
+
+
+ abstract
and
@@ -38,28 +41,28 @@
as
+
+
break
-
-
+
+ callable (as of PHP 5.4)
+
case
- catch (as of PHP 5)
-
-
- cfunction (PHP 4 only)
+ catch
class
-
- clone (as of PHP 5)
-
+
+ clone
+
const
@@ -72,17 +75,28 @@
default
+
+
+
+ die
+
do
-
-
+
+ echo
+
else
elseif
+
+
+
+ empty
+
enddeclare
@@ -92,11 +106,11 @@
endforeach
-
-
endif
+
+
endswitch
@@ -104,13 +118,19 @@
endwhile
- extends
+ eval
- final (as of PHP 5)
+ exit
+
+
+ extends
+
+ final
+
for
@@ -123,22 +143,39 @@
global
+
+
goto (as of PHP 5.3)
-
-
if
- implements (as of PHP 5)
+ implements
- interface (as of PHP 5)
+ include
- instanceof (as of PHP 5)
+ include_once
+
+
+
+
+ instanceof
+
+
+ insteadof (as of PHP 5.4)
+
+
+ interface
+
+
+ isset
+
+
+ list
@@ -148,23 +185,34 @@
new
-
- old_function (PHP 4 only)
-
or
- private (as of PHP 5)
+ print
+
+
+ private
- protected (as of PHP 5)
+ protected
- public (as of PHP 5)
+ public
+
+ require
+
+
+ require_once
+
+
+ return
+
+
+
static
@@ -172,12 +220,18 @@
switch
- throw (as of PHP 5)
+ throw
+
+
+ trait (as of PHP 5.4)
+
+
+ try
- try (as of PHP 5)
+ unset
use
@@ -195,6 +249,7 @@
+