PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

定義済のクラス> <関数エイリアスのリスト
Last updated: Fri, 05 Sep 2008

view this page in

予約語の一覧

目次

以下に PHP で定義済みの ID の一覧を示します。ここに示す ID はいずれも スクリプトの中で ID として使用することはできません。これらの一覧には キーワード、定義済みの変数、定数、クラス名が含まれています。これらの一覧は、 全てを網羅しているわけではありません。

キーワードのリスト

これらのキーワードは、PHP では特別な意味があります。これらのいくつかは 関数やメソッドのようなものを表し、いくつかは定数のようなものを表す、 といったようになっていますが、実際にはそうではありません。実際には、 これらは言語を構成するものです。以下のキーワードはいずれも定数、クラス名、 関数名として使用することはできません。 これらを変数名として使用することは一般的には可能ですが、 混乱を生じる可能性があります。

PHP のキーワード
abstract (PHP 5 以降) and array() as break
case catch (PHP 5 以降) cfunction (PHP 4 のみ) class clone (PHP 5 以降)
const continue declare default do
else elseif enddeclare endfor endforeach
endif endswitch endwhile extends final (PHP 5 以降)
for foreach function global goto (PHP 5.3 以降)
if implements (PHP 5 以降) interface (PHP 5 以降) instanceof (PHP 5 以降)
namespace (PHP 5.3 以降) new old_function (PHP 4 のみ) or private (PHP 5 以降)
protected (PHP 5 以降) public (PHP 5 以降) static switch this (PHP 5 以降)
throw (PHP 5 以降) try (PHP 5 以降) use var while
xor
コンパイル時の定数
__CLASS__ __DIR__ (PHP 5.3 以降) __FILE__ __FUNCTION__ __METHOD__
__NAMESPACE__ (PHP 5.3 以降)
言語の定数
die() echo() empty() exit() eval()
include() include_once() isset() list() require()
require_once() return() print() unset()


定義済のクラス> <関数エイリアスのリスト
Last updated: Fri, 05 Sep 2008
 
add a note add a note User Contributed Notes
予約語の一覧
SR
04-Oct-2007 07:53
[Editorial note: parent and self are reserved class names. Functions and constants with their names can be declared, but not userspace classes]

true, false and null are not listed because they are globally-defined constants, not reserved words.

No idea about parent or self, though.
londonx at gmail dot com
05-Mar-2007 11: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.
01-Nov-2006 01:42
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?)
10-Jan-2006 12:41
I don't see the boolean constants 'true' and 'false' listed among the reserved words/keywords/constants.

定義済のクラス> <関数エイリアスのリスト
Last updated: Fri, 05 Sep 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites