update page now
Longhorn PHP 2026 - Call For Papers

The ReflectionObject class

(PHP 5, PHP 7, PHP 8)

Introduction

The ReflectionObject class reports information about an object.

Class synopsis

class ReflectionObject extends ReflectionClass {
/* Inherited constants */
/* Inherited properties */
public string $name;
/* Methods */
public function __construct(object $object)
/* Inherited methods */
public static function ReflectionClass::export(mixed $argument, bool $return = false): string
public function ReflectionClass::getAttributes(?string $name = null, int $flags = 0): array
public function ReflectionClass::getConstant(string $name): mixed
public function ReflectionClass::getConstants(?int $filter = null): array
public function ReflectionClass::getMethods(?int $filter = null): array
public function ReflectionClass::getName(): string
public function ReflectionClass::getProperties(?int $filter = null): array
public function ReflectionClass::getStaticPropertyValue(string $name, mixed &$def_value = ?): mixed
public function ReflectionClass::hasConstant(string $name): bool
public function ReflectionClass::hasMethod(string $name): bool
public function ReflectionClass::hasProperty(string $name): bool
public function ReflectionClass::isEnum(): bool
public function ReflectionClass::isFinal(): bool
public function ReflectionClass::isInstance(object $object): bool
public function ReflectionClass::isTrait(): bool
public function ReflectionClass::newInstance(mixed ...$args): object
public function ReflectionClass::newInstanceArgs(array $args = []): ?object
public function ReflectionClass::newLazyGhost(callable $initializer, int $options = 0): object
public function ReflectionClass::newLazyProxy(callable $factory, int $options = 0): object
public function ReflectionClass::resetAsLazyGhost(object $object, callable $initializer, int $options = 0): void
public function ReflectionClass::resetAsLazyProxy(object $object, callable $factory, int $options = 0): void
}

Changelog

Version Description
8.0.0 ReflectionObject::export() was removed.

Table of Contents

add a note

User Contributed Notes 1 note

up
4
marcel dot nolte at noltecomputer dot de
16 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