array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'function.get-class-methods.php', 1 => 'get_class_methods', ), 'up' => array ( 0 => 'ref.classobj.php', 1 => 'Sınıf ve Nesne İşlevleri', ), 'prev' => array ( 0 => 'function.get-called-class.php', 1 => 'get_called_class', ), 'next' => array ( 0 => 'function.get-class-vars.php', 1 => 'get_class_vars', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'tr', 'path' => 'reference/classobj/functions/get-class-methods.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
get_class_methods — Sınıf yöntemlerinin isimlerini döndürür
Sınıf yöntemlerinin isimlerini döndürür.
nesne_veya_sınıf
Sınıf veya nesne ismi.
Sınıf yöntemlerinin isimlerini bir dizi olarak döndürür. Hata durumunda
null
döner.
Sürüm: | Açıklama |
---|---|
8.0.0 |
nesne_veya_sınıf bağımsız değişkeni artık sadece
nesneleri veya sınıf isimlerini kabul ediyor.
|
Örnek 1 - get_class_methods() örneği
<?php
class myclass {
// kurucu
function __construct()
{
return(true);
}
// 1. yöntem
function myfunc1()
{
return(true);
}
// 2. yöntem
function myfunc2()
{
return(true);
}
}
$class_methods = get_class_methods('myclass');
// veya
$class_methods = get_class_methods(new myclass());
foreach ($class_methods as $method_name) {
echo "$method_name\n";
}
?>
Yukarıdaki örneğin çıktısı:
__construct myfunc1 myfunc2