(PHP 5)
ReflectionFunction::__construct — ReflectionFunction ・ェ・ヨ・ク・ァ・ッ・ネ、鋿ョ、ケ、�
テヘ、ヨ、キ、゙、サ、」
name ・ム・鬣癸シ・ソ、ャタオ、キ、、エリソセ、ヌ、ハ、、セ�遉ヒ ReflectionException 、ャネッタク、キ、゙、ケ。」
ホ�1 ReflectionFunction::__construct() 、ホホ�
<?php
/**
* エハテア、ハ・ォ・ヲ・ソ
*
* @return int
*/
function counter1()
{
static $c = 0;
return ++$c;
}
/**
* ハフ、ホエハテア、ハ・ォ・ヲ・ソ
*
* @return int
*/
$counter2 = function()
{
static $d = 0;
return ++$d;
};
function dumpReflectionFunction($func)
{
// エワセスシィ、キ、゙、ケ
printf(
"\n\n===> 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));
?>
セ螟ホホ网ホスミホマ、マ。「 、ソ、ネ、ィ、ミーハイシ、ホ、隍ヲ、ヒ、ハ、熙゙、ケ。」
===> 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, )