色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

PHP 類相關函數的使用詳解

bool class_alias ( string $original , string $alias [, bool $autoload = TRUE ] ) ― 為一個類創建別名
bool class_exists ( string $class_name [, bool $autoload ] )― 檢查類是否已定義
string get_called_class ( void ) ―獲取靜態方法調用的類名
復制代碼 代碼如下:
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 )― 返回由類的方法名組成的數組
array get_class_vars ( string $class_name )― 返回由類的默認屬性組成的數組
string get_class ([ object $obj ] )― 返回對象的類名
array get_declared_classes ( void )― 返回當前腳本中已定義類的名字組成的數組
array get_declared_interfaces ( void )― 返回當前腳本中所有已聲明的接口的名字數組
array get_object_vars ( object $obj )― 返回由對象屬性組成的關聯數組
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技術PHP 類相關函數的使用詳解,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 临武县| 肇源县| 炉霍县| 吉水县| 延吉市| 日喀则市| 上虞市| 安福县| 新巴尔虎左旗| 高清| 咸阳市| 无为县| 临沂市| 临沧市| 克东县| 岗巴县| 涡阳县| 招远市| 内丘县| 锡林浩特市| 绵阳市| 邵阳市| 万州区| 贵溪市| 岱山县| 杭锦旗| 皮山县| 荆门市| 广灵县| 黑龙江省| 平乡县| 华池县| 岳西县| 额尔古纳市| 股票| 鄯善县| 黄浦区| 巴彦县| 呼伦贝尔市| 宾阳县| 龙里县|