ReflectionFunction
PHP Manual

ReflectionFunction::__construct

(PHP 5)

ReflectionFunction::__constructReflectionFunction ・ェ・ヨ・ク・ァ・ッ・ネ、鋿ョ、ケ、�

タ篶タ

ReflectionFunction::__construct ( mixed $name )

ReflectionFunction ・ェ・ヨ・ク・ァ・ッ・ネ、鋿ョ、キ、゙、ケ。」

・ム・鬣癸シ・ソ

name

トエ、ル、ソ、、エリソ「、�、、マ・ッ・悅シ・ク・�、ホフセチー。」

ハヨ、�ヘ

テヘ、ヨ、キ、゙、サ、」

・ィ・鬘シ / ホ羌ー

name ・ム・鬣癸シ・ソ、ャタオ、キ、、エリソセ、ヌ、ハ、、セ�遉ヒ ReflectionException 、ャネッタク、キ、゙、ケ。」

ハムケケヘ昀�

・ミ。シ・ク・逾� タ篶タ
5.3.0 name 、ヒ ・ッ・悅シ・ク・� 、リト熙ヌ、ュ、�隍ヲ、ヒ、ハ、熙゙、キ、ソ。」

ホ�

ホ�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($statics1));
    }
}

// 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,
)

サイケヘ


ReflectionFunction
PHP Manual