ReflectionFunction::__construct ReflectionFunction オブジェクトを作成する &reftitle.description; public ReflectionFunction::__construct mixedname ReflectionFunction オブジェクトを作成します。 &reftitle.parameters; name 調べたい関数あるいはクロージャの名前。 &reftitle.returnvalues; &return.void; &reftitle.errors; name パラメータが正しい関数名でない場合に ReflectionException が発生します。 &reftitle.changelog; &Version; &Description; 5.3.0 nameクロージャ を指定できるようになりました。 &reftitle.examples; <methodname>ReflectionFunction::__construct</methodname> の例 The %s function '%s'\n". " declared in %s\n". " lines %d to %d\n", $func->isInternal() ? 'internal' : 'user-defined', $func->getName(), $func->getFileName(), $func->getStartLine(), $func->getEndline() ); // ドキュメントコメントを表示します printf("---> Documentation:\n %s\n", var_export($func->getDocComment(), 1)); // 静的変数が存在すれば表示します if ($statics = $func->getStaticVariables()) { printf("---> Static variables: %s\n", var_export($statics, 1)); } } // ReflectionFunction クラスのインスタンスを作成します dumpReflectionFunction(new ReflectionFunction('counter1')); dumpReflectionFunction(new ReflectionFunction($counter2)); ?> ]]> &example.outputs.similar; The user-defined function 'counter1' declared in Z:\reflectcounter.php lines 7 to 11 ---> Documentation: '/** * 簡単なカウンタ * * @return int */' ---> Static variables: array ( 'c' => 0, ) ===> The user-defined function '{closure}' declared in Z:\reflectcounter.php lines 18 to 23 ---> Documentation: '/** * 別の簡単なカウンタ * * @return int */' ---> Static variables: array ( 'd' => 0, ) ]]> &reftitle.seealso; ReflectionMethod::__construct コンストラクタ