Php/docs/class.reflectionparameter

提供:Dev Guides
< Php
移動先:案内検索

(PHP 5, PHP 7)

はじめに

ReflectionParameter クラスは、 関数またはメソッドのパラメータに関する情報を取得します。

関数パラメータの内部を調べる際には、まず ReflectionFunction クラスまたは ReflectionMethod クラスのインスタンスを作成する必要があります。次に、 ReflectionFunctionAbstract::getParameters() メソッドを使ってパラメータの配列を取得します。


クラス概要


ReflectionParameter implements Reflector {

/* プロパティ */

public $name

/* メソッド */

public allowsNull ( ) : bool

public canBePassedByValue ( ) : bool

final private __clone ( ) : void

public __construct ( callable $function , mixed $parameter )

public static export ( string $function , string $parameter [, bool $return ] ) : string

public getClass ( ) : ReflectionClass

public getDefaultValue ( ) : mixed

public getDefaultValueConstantName ( ) : string

public getName ( ) : string

public getPosition ( ) : int

public getType ( ) : ReflectionType

public hasType ( ) : bool

public isArray ( ) : bool

public isCallable ( ) : bool

public isDefaultValueAvailable ( ) : bool

public isDefaultValueConstant ( ) : bool

public isOptional ( ) : bool

public isPassedByReference ( ) : bool

public isVariadic ( ) : bool

public __toString ( ) : string

}

プロパティ

name
パラメータ名。読み込み専用で、書き込もうとすると ReflectionException をスローします。


目次