ReflectionObject 類

ReflectionObject 類

(PHP 5, PHP 7, PHP 8)

簡介

ReflectionObject 類報告了一個對像(object)的相關資訊。

類摘要

class ReflectionObject extends ReflectionClass implements Reflector {
/* 常量 */
const integer IS_IMPLICIT_ABSTRACT = 16;
const integer IS_EXPLICIT_ABSTRACT = 32;
const integer IS_FINAL = 64;
/* 屬性 */
public $name;
/* 方法 */
public static export(string $argument, bool $return = ?): string
/* 繼承的方法 */
public static ReflectionClass::export(mixed $argument, bool $return = false): string
public ReflectionClass::getAttributes(?string $name = null, int $flags = 0): array
public ReflectionClass::getConstant(string $name): mixed
public ReflectionClass::getConstants(?int $filter = null): array
public ReflectionClass::getMethods(int $filter = ?): array
public ReflectionClass::getName(): string
public ReflectionClass::getProperties(int $filter = ?): array
public ReflectionClass::getReflectionConstants(?int $filter = null): array
public ReflectionClass::getStaticPropertyValue(string $name, mixed &$def_value = ?): mixed
public ReflectionClass::hasConstant(string $name): bool
public ReflectionClass::hasMethod(string $name): bool
public ReflectionClass::hasProperty(string $name): bool
public ReflectionClass::implementsInterface(string $interface): bool
public ReflectionClass::isInstance(object $object): bool
public ReflectionClass::isSubclassOf(string $class): bool
public ReflectionClass::newInstance(mixed $args, mixed $... = ?): object
public ReflectionClass::newInstanceArgs(array $args = ?): object
public ReflectionClass::setStaticPropertyValue(string $name, string $value): void
}

屬性

name

對象的類名。只讀,在嘗試賦值的時候會拋出 ReflectionException

目錄

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *