true, false and null are not listed because they are globally-defined constants, not reserved words.
No idea about parent or self, though.
Liste der reservierten Wörter
Inhaltsverzeichnis
Die folgenden Listen enthält in PHP vordefinierten Bezeichner. Sie sollten die reservierten Worte aus diesen Listen keinesfalls in eigenen Scripten als Bezeichner benutzen. Die Listen enthält Schlüsselworte, vordefinierte Variablen, Konstanten und Klassennamen. Beachten Sie bitte auch das diese Listen nicht unbedingt vollständig sind.
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.
| and | or | xor | __FILE__ | exception (PHP 5) |
| __LINE__ | array() | as | break | case |
| class | const | continue | declare | default |
| die() | do | echo() | else | elseif |
| empty() | enddeclare | endfor | endforeach | endif |
| endswitch | endwhile | eval() | exit() | extends |
| for | foreach | function | global | if |
| include() | include_once() | isset() | list() | new |
| print() | require() | require_once() | return() | static |
| switch | unset() | use | var | while |
| __FUNCTION__ | __CLASS__ | __METHOD__ | final (ab PHP 5) | php_user_filter (ab PHP 5) |
| interface (ab PHP 5) | implements (ab PHP 5) | instanceof (ab PHP 5) | public (ab PHP 5) | private (ab PHP 5) |
| protected (ab PHP 5) | abstract (ab PHP 5) | clone (ab PHP 5) | try (ab PHP 5) | catch (ab PHP 5) |
| throw (ab PHP 5) | cfunction (nur in PHP 4) | old_function (nur in PHP 4) | this (ab PHP 5) | final (ab PHP 5) |
| namespace (ab PHP 5.3) | __NAMESPACE__ (ab PHP 5.3) | goto (ab PHP 6) | __DIR__ (ab PHP 5.3) |
Liste der reservierten Wörter
05-Oct-2007 01:53
05-Mar-2007 06:14
Naming a PHP5 class "variant" (with a constructor called the same) and then making an instance of it using __autoload triggers an error which disappears as soon as the name is changed. This should mean that "variant" is also a reserved word.
Two things:
1. It would be nice for this list to differentiate those reserved words, which are language constructs used *with* parentheses (isset, unset, empty, eval, exit, die, ...) and those rather to be used *without* parentheses (all includes, echo, print, return, ...?)
This would really help define some common coding styles...
2. Do you write NULL, TRUE, FALSE or null, true, false? (I find CAPITAL letters better, however typing them can be annoying so I stick with using all lowercase letters, but what's the standard?)
05-May-2006 12:38
The list also seems to be missing both "parent" and "self" as well.
01-Feb-2006 01:32
I also can't find the NULL keyword in the list. The `extends' keyword is mentioned twice, too.
I don't see the boolean constants 'true' and 'false' listed among the reserved words/keywords/constants.
