PHP 8.4.2 Released!

ReflectionObject 类

(PHP 5, PHP 7, PHP 8)

简介

ReflectionObject 类报告了 object 的相关信息。

类摘要

class ReflectionObject extends ReflectionClass {
/* 继承的常量 */
/* 继承的属性 */
public string $name;
/* 方法 */
public __construct(object $object)
/* 继承的方法 */
public static ReflectionClass::export(mixed $argument, bool $return = false): string
public ReflectionClass::getAttributes(?string $name = null, int $flags = 0): array
public ReflectionClass::newLazyGhost(callable $initializer, int $options = 0): object
public ReflectionClass::newLazyProxy(callable $factory, int $options = 0): object
public ReflectionClass::resetAsLazyGhost(object $object, callable $initializer, int $options = 0): void
public ReflectionClass::resetAsLazyProxy(object $object, callable $factory, int $options = 0): void
}

更新日志

版本 说明
8.0.0 已移除 ReflectionObject::export()

目录

添加备注

用户贡献的备注 1 note

up
6
marcel dot nolte at noltecomputer dot de
15 years ago
To simply enlist all methods and properties of an object simply write:

<?php ReflectionObject::export($yourObject); ?>

,which will cause an var_export-like output.
To Top