downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ReflectionFunction::export> <ReflectionFunction
[edit] Last updated: Fri, 23 Mar 2012

view this page in

ReflectionFunction::__construct

(PHP 5)

ReflectionFunction::__constructBir ReflectionFunction nesnesi oluşturur

Açıklama

ReflectionFunction::__construct ( string $isim )

Bir ReflectionFunction nesnesi oluşturur.

Değiştirgeler

name

Yansıtılılacak işlevin ismi.

Dönen Değerler

Hiçbir değer dönmez.

Hatalar/İstisnalar

isim değiştirgesi geçerli bir işlev ismi içermiyorsa bir ReflectionException nesnesi döner.

Örnekler

Örnek 1 - ReflectionFunction::__construct() örneği

<?php
/**
 * Basit bir sayaç
 *
 * @return    int
 */
function sayaç()
{
    static 
$c 0;
    return ++
$c;
}

// Bir ReflectionFunction örneği oluşturalım
$func = new ReflectionFunction('sayaç');

// Temel bilgileri basalım
printf(
    
"===> %s '%s' işlevi\n".
    
"     %s dosyasının\n".
    
"     %d. satırından %d. satırına kadar tanımlanmış\n",
    
$func->isInternal() ? 'Yerleşik' 'Kullanıcı tanımlı',
    
$func->getName(),
    
$func->getFileName(),
    
$func->getStartLine(),
    
$func->getEndline()
);

// Belgelendirici açıklamaları basalım
printf("---> Belgeleme:\n %s\n"var_export($func->getDocComment(), 1));

// Varsa duruk değişkenleri basalım
if ($statics $func->getStaticVariables())
{
    
printf("---> Duruk değişkenler: %s\n"var_export($statics1));
}
?>

Yukarıdaki örnek şuna benzer bir çıktı üretir:

===> Kullanıcı tanımlı 'sayaç' işlevi
     /home/Nilgun/dnm.php dosyasının
     7. satırından 11. satırına kadar tanımlanmış
---> Belgeleme:
 '/**
 * Basit bir sayaç
 *
 * @return    int
 */'
---> Duruk değişkenler: array (
  'c' => 0,
)

Ayrıca Bakınız



add a note add a note User Contributed Notes ReflectionFunction::__construct
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites