Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<ReflectionObject::exportReflectionParameter::allowsNull>
^ReflectionLast updated: Mon, 26 Oct 2026

The ReflectionParameter class

(PHP 5, PHP 7, PHP 8)

Introduction

The ReflectionParameter class retrieves information about function's or method's parameters.

To introspect function parameters, first create an instance of the ReflectionFunction or ReflectionMethod classes and then use their ReflectionFunctionAbstract::getParameters() method to retrieve an array of parameters.

Class synopsis

class ReflectionParameter implements Reflector {
/* Properties */
public string $name;
/* Methods */
public function __construct(string|array|object $function, int|string $param)
public function allowsNull(): bool
public function canBePassedByValue(): bool
private function __clone(): void
public static function export(string $function, string $parameter, bool $return = ?): string
public function getAttributes(?string $name = null, int $flags = 0): array
#[\Deprecated(
    since: '8.0',
    message: "use ReflectionParameter::getType() instead",
)]

public function getClass(): ?ReflectionClass
public function getDefaultValue(): mixed
public function getName(): string
public function getPosition(): int
public function getType(): ?ReflectionType
public function hasType(): bool
#[\Deprecated(
    since: '8.0',
    message: "use ReflectionParameter::getType() instead",
)]

public function isArray(): bool
#[\Deprecated(
    since: '8.0',
    message: "use ReflectionParameter::getType() instead",
)]

public function isCallable(): bool
public function isDefaultValueAvailable(): bool
public function isDefaultValueConstant(): bool
public function isOptional(): bool
public function isPassedByReference(): bool
public function isPromoted(): bool
public function isVariadic(): bool
public function __toString(): string
}

Properties

name

Name of the parameter. Read-only, throws ReflectionException in attempt to write.

Changelog

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

Table of Contents


<ReflectionObject::exportReflectionParameter::allowsNull>
^ReflectionLast updated: Mon, 26 Oct 2026