ReflectionClass::__construct
ReflectionClass を作成する
&reftitle.description;
public ReflectionClass::__construct
objectstringobjectOrClass
新しい ReflectionClass オブジェクトを作成します。
&reftitle.parameters;
objectOrClass
調べたいクラスのクラス名をあらわす文字列か、そのクラスのオブジェクト。
&reftitle.errors;
リフレクションするクラスが存在しない場合、
ReflectionException がスローされます。
&reftitle.examples;
ReflectionClass の基本的な使用例
]]>
&example.outputs.similar;
class Exception implements Stringable, Throwable ] {
- Constants [0] {
}
- Static properties [0] {
}
- Static methods [0] {
}
- Properties [7] {
Property [ protected $message = '' ]
Property [ private string $string = '' ]
Property [ protected $code = 0 ]
Property [ protected string $file = '' ]
Property [ protected int $line = 0 ]
Property [ private array $trace = [] ]
Property [ private ?Throwable $previous = NULL ]
}
- Methods [11] {
Method [ private method __clone ] {
- Parameters [0] {
}
- Return [ void ]
}
Method [ public method __construct ] {
- Parameters [3] {
Parameter #0 [ string $message = "" ]
Parameter #1 [ int $code = 0 ]
Parameter #2 [ ?Throwable $previous = null ]
}
}
Method [ public method __wakeup ] {
- Parameters [0] {
}
- Tentative return [ void ]
}
Method [ final public method getMessage ] {
- Parameters [0] {
}
- Return [ string ]
}
Method [ final public method getCode ] {
- Parameters [0] {
}
}
Method [ final public method getFile ] {
- Parameters [0] {
}
- Return [ string ]
}
Method [ final public method getLine ] {
- Parameters [0] {
}
- Return [ int ]
}
Method [ final public method getTrace ] {
- Parameters [0] {
}
- Return [ array ]
}
Method [ final public method getPrevious ] {
- Parameters [0] {
}
- Return [ ?Throwable ]
}
Method [ final public method getTraceAsString ] {
- Parameters [0] {
}
- Return [ string ]
}
Method [ public method __toString ] {
- Parameters [0] {
}
- Return [ string ]
}
}
}
]]>
&reftitle.seealso;
ReflectionObject::__construct
コンストラクタ