PHP 類相關(guān)函數(shù)的使用詳解_PHP教程
推薦:PHP 自定義錯誤處理函數(shù)的使用詳解本篇文章是對PHP自定義錯誤處理函數(shù)的使用進(jìn)行了詳細(xì)的分析介紹。需要的朋友參考下
bool class_alias ( string $original , string $alias [, bool $autoload = TRUE ] ) — 為一個類創(chuàng)建別名
bool class_exists ( string $class_name [, bool $autoload ] )— 檢查類是否已定義
string get_called_class ( void ) —獲取靜態(tài)方法調(diào)用的類名
class foo {
static public function test(){
var_dump(get_called_class());
}
}
class bar extends foo {}
foo::test();
bar::test();
array get_class_methods ( mixed $class_name )— 返回由類的方法名組成的數(shù)組
array get_class_vars ( string $class_name )— 返回由類的默認(rèn)屬性組成的數(shù)組
string get_class ([ object $obj ] )— 返回對象的類名
array get_declared_classes ( void )— 返回當(dāng)前腳本中已定義類的名字組成的數(shù)組
array get_declared_interfaces ( void )— 返回當(dāng)前腳本中所有已聲明的接口的名字?jǐn)?shù)組
array get_object_vars ( object $obj )— 返回由對象屬性組成的關(guān)聯(lián)數(shù)組
string get_parent_class ([ mixed $obj ] )— 返回對象或類的父類名
bool interface_exists ( string $interface_name [, bool $autoload ] )— 檢查接口是否已被定義
bool is_a ( object $object , string $class_name )— 如果對象屬于該類或該類是此對象的父類則返回 TRUE
bool is_subclass_of ( object $object , string $class_name )— 檢測對象是該類的子類實例化得到的
bool method_exists ( object $object , string $method_name )— 檢查類的方法是否存在
bool property_exists ( mixed $class , string $property ) — 檢查對象或類是否具有該屬性
分享:解析php DOMElement 操作xml 文檔的實現(xiàn)代碼本篇文章是對在php中DOMElement 操作xml 文檔的實現(xiàn)進(jìn)行了分析介紹。需要的朋友參考下
- PHPNOW安裝Memcached擴(kuò)展方法詳解
- php記錄頁面代碼執(zhí)行時間
- PHP中獎概率的抽獎算法程序代碼
- apache設(shè)置靜態(tài)文件緩存方法介紹
- php對圖像的各種處理函數(shù)代碼小結(jié)
- PHP 關(guān)于訪問控制的和運算符優(yōu)先級介紹
- 關(guān)于PHP語言構(gòu)造器介紹
- php/js獲取客戶端mac地址的實現(xiàn)代碼
- php5.5新數(shù)組函數(shù)array_column使用
- PHP preg_match的匹配多國語言的技巧
- php 中序列化和json使用介紹
- php采集文章中的圖片獲取替換到本地
- 相關(guān)鏈接:
- 教程說明:
PHP教程-PHP 類相關(guān)函數(shù)的使用詳解
。