PHP Conference Kansai 2025

La classe ReflectionObject

(PHP 5, PHP 7, PHP 8)

Introduction

La classe ReflectionObject rapporte des informations sur un object.

Synopsis de la classe

class ReflectionObject extends ReflectionClass {
/* Constantes héritées */
/* Propriétés héritées */
public string $name;
/* Méthodes */
public __construct(object $object)
/* Méthodes héritées */
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
}

Historique

Version Description
8.0.0 ReflectionObject::export() a été supprimée.

Sommaire

add a note

User Contributed Notes 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