ReflectionClass クラス

(PHP 5, PHP 7, PHP 8)

はじめに

ReflectionClass クラスは クラスについての情報を報告します。

クラス概要

classReflectionClassimplementsReflector {
publicconstintIS_FINAL;
publicconstintIS_READONLY;
public__construct(object|string$objectOrClass)
publicstaticexport(mixed$argument, bool$return = false): string
publicgetAttributes(?string$name = null, int$flags = 0): array
publicgetConstant(string$name): mixed
publicgetConstants(?int$filter = null): array
publicgetMethods(?int$filter = null): array
publicgetModifiers(): int
publicgetName(): string
publicgetProperties(?int$filter = null): array
publicgetStaticPropertyValue(string$name, mixed&$def_value = ?): mixed
publicgetTraits(): array
publichasConstant(string$name): bool
publichasMethod(string$name): bool
publichasProperty(string$name): bool
publicinNamespace(): bool
publicisAbstract(): bool
publicisAnonymous(): bool
publicisCloneable(): bool
publicisEnum(): bool
publicisFinal(): bool
publicisInstance(object$object): bool
publicisInterface(): bool
publicisInternal(): bool
publicisIterable(): bool
publicisReadOnly(): bool
publicisTrait(): bool
publicnewInstance(mixed...$args): object
publicnewInstanceArgs(array$args = []): ?object
}

プロパティ

name

クラス名。読み込み専用で、書き込もうとすると ReflectionException をスローします。

定義済み定数

ReflectionClass の修飾子

ReflectionClass::IS_IMPLICIT_ABSTRACT

抽象メソッドを持っているので abstract クラスであることを示します。

ReflectionClass::IS_EXPLICIT_ABSTRACT

その定義から abstract クラスであることを示します。

ReflectionClass::IS_FINAL

final クラスであることを示します。

ReflectionClass::IS_READONLY

readonly クラスであることを示します。

変更履歴

バージョン説明
8.0.0ReflectionClass::export() は、削除されました。

目次

To Top