namespace foo;
class a
{
private $bar;
public $baz;
protected $alpha
}
$reflect=new \ReflectionClass('a');
$properties=$reflect->getProperties(ReflectionProperty::IS_PROTECTED);
クラスが見つからないという致命的なエラーが返されReflectionProperty
ます $properties は のオブジェクトの配列ですReflectionProperty
。グローバル空間に自動的に解決されないのはなぜですか? DOM関連のクラスは暗黙的にそれを行います。ReflectionProperty
class がuse
名前空間で d の場合でも機能します。しかし、暗黙のうちにそれが起こらないのはなぜですか?