Reflection
PHP Manual

The ReflectionParameter class

(PHP 5)

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

ReflectionParameter implements Reflector {
/* Properties */
public $name ;
/* Methods */
public bool allowsNull ( void )
public bool canBePassedByValue ( void )
final private void __clone ( void )
public __construct ( string $function , string $parameter )
public static string export ( string $function , string $parameter [, bool $return ] )
public ReflectionClass getClass ( void )
public ReflectionClass getDeclaringClass ( void )
public ReflectionFunction getDeclaringFunction ( void )
public mixed getDefaultValue ( void )
public string getName ( void )
public int getPosition ( void )
public bool isArray ( void )
public bool isDefaultValueAvailable ( void )
public bool isOptional ( void )
public bool isPassedByReference ( void )
public string __toString ( void )
}

Properties

name

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

Table of Contents


Reflection
PHP Manual