这些词语在 PHP 中有着特殊的意义。它们中有些像是函数,有些像是常量……但是它们不是的,它们只是语言结构的一部分。不能使用它们的任何一个作为常量、方法名或是类名。但是可以将它们作为变量名使用,不过这样会导致混淆。
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 (PHP 5) | php_user_filter (PHP 5) |
interface (PHP 5) | implements (PHP 5) | extends | public (PHP 5) | private (PHP 5) |
protected (PHP 5) | abstract (PHP 5) | clone (PHP 5) | try (PHP 5) | catch (PHP 5) |
throw (PHP 5) | cfunction (PHP 4 only) | this (PHP 5 only) |