Php/docs/class.reflectionparameter

提供:Dev Guides
< Php
2020年12月14日 (月) 12:31時点におけるNotes (トーク | 投稿記録)による版 (autoload)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先:案内検索

(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 をスローします。


目次