get_object_vars():获得对象的属性,以关联数组形式返回

get_parent_class():获得对象的父类
is_subclass_of():判断对象是否某类(参数2)的子类实例出的,返回int类型(祖孙级) 

interface_exists():判断接口是否存在

get_class():获得实例化对象的类名,在类内部调用时,不需要传入对象名。区分大小写
get_declared_classes():以数组形式返回当前脚本定义的类
get_declared_interfaces():以数组形式返回当前定义的接口
method_exists(): 判断方法是否存在,第一个参数对象或类名,第二个参数就是方法
property_exists():判断属性是否在对象或类中,第一个参数可以是对象或类名,第二参数为属性名
instanceof:判断对象是否是类实例化出的

php对象:get_object_vars(), get_parent_class(),is_subclass_of(),interface_exists()的更多相关文章

  1. 017对象——对象 get_object_vars get_parent_class is_subclass_of interface_exists

    <?php /** */ //get_object_vars($obj) 获得对象的属性,以关联数据形式返回. /*class study{ public $name; public $age; ...

  2. PHP类和对象函数实例详解

    1. interface_exists.class_exists.method_exists和property_exists: 顾名思义,从以上几个函数的命名便可以猜出几分他们的功能.我想这也是我随着 ...

  3. php之基础深入---类与对象篇

    1.类的自动加载: spl_autoload_register()函数可以注册任意数量的自动加载器,当使用尚未被定义的类(class)和接口(interface)时自动去加载,这样可以避免includ ...

  4. php有关类和对象的相关知识2

    与类有关的魔术常量: __CLASS__,:获取其所在的类的类名. __METHOD__:获取其所在的方法的方法名. class A{ function f1(){ echo __CLASS__: / ...

  5. php -- instanceof、class_exists、insterface_exists、method_exists、get_class、get_parent_class

    class_exists:类是否存在 在创建对象之前判断类是否存在,如果不存在就应该先加载类,再创建对象,容错. interface_exists:接口是否存在 method_exists:方法是否存 ...

  6. 用trie树实现输入提示功能,输入php函数名,提示php函数

    参照刘汝佳的trie树 结构体 #include "stdio.h" #include "stdlib.h" #include "string.h&q ...

  7. GeSHi Documentation

    GeSHi Documentation Version 1.0.8.11 Authors: © 2004 - 2007 Nigel McNie © 2007 - 2012 Benny Baumann ...

  8. PHP 函数总结

    感觉对函数了解的不够深,从头到尾梳理一遍(更新中....) 1,class_exists(),interface_exists(),method_exists(),get_class(),get_pa ...

  9. 16/8/21_PHP-有关类函数,this,static,面向对象思想介绍

    class_exists():判断某个类是否存在(定义过) interface_existe():判断接口是否存在 get_class():获取某个对象的"所属类名" get_pa ...

随机推荐

  1. 99乘法表(for循环嵌套)

    计算乘法表 两个数相乘,外层循环代表被乘数,控制行数:内层代表乘数,控制列数. 循环嵌套,变量名不可以重复. 使用 break 语句让输出的乘法表更简洁. 使用 String 变量,做 String ...

  2. 六、Vue-Router:基础路由处理、路由提取成单独文件、路由嵌套、路由传参数、路由高亮、html5的history使用

    一.vue-router的安装 官网文档 [官网]:https://cn.vuejs.org/v2/guide/routing.html [router文档]:https://router.vuejs ...

  3. ApplicationListener监听使用ContextRefreshedEvent事件类型会触发多次

    @Componentpublic class TestApplicationListener implements ApplicationListener<ContextRefreshedEve ...

  4. python基础数据类型--列表(list)

    python基础数据类型--列表(list) 列表是我们在后面经常用到的数据类型之一,通过列表可以对数据类型进行增.删.改.查等操作 一列表的增.删.改.查 1增: 1.1增加到最后   append ...

  5. 关于linux 交叉编译器的安装

    找了几个贴 https://www.cnblogs.com/uestc-mm/p/6656325.html 这个最好

  6. layui-注册界面

    注册页面register.html源代码: <!DOCTYPE html> <html lang="en"> <head> <meta c ...

  7. Android Studio 移动虚拟机

    突然间发现C盘 空间占用量增加了很多,经过找寻原因之后发现是因为安装了虚拟机的原因:在Android Studio中安装运行虚拟机时,默认的安装路径一般都在C盘,对于我这种不喜欢C盘存储太满的人来说是 ...

  8. 11.json

    import json # json反序列化 # json_str = '{"name":"qiyue","age":18}' # stud ...

  9. 025-PHP常用字符串函数(二)

    <?php $text = "My dog's name is Angus."; //print Angus print(substr($text, , )."&l ...

  10. 055-for循环中break的使用

    <?php ;;$x++){ //省略表达式2的for循环将是无限循环 echo "$x<br />"; ){ break; //使用if语句控制退出无限循环 } ...