Home >Backend Development >PHP Tutorial >PHP system functions and operators related to classes and objects

PHP system functions and operators related to classes and objects

WBOY
WBOYOriginal
2016-07-29 09:01:31891browse

System function

  • class_exists()
    Determine whether a class exists
  • interface_exists()
    Determine whether the interface exists
  • get_class()
    Get the class name of an object
  • get_parent_class()
    Get the class name of the parent class to which an object belongs
  • get_class_methods()
    Get all methods of a class and return the index array
  • get_class_vars()
    Get all attributes of a class, the subscript is the attribute name
  • get_declared_classes()
    Get all declared classes (including system classes)
  • is_object()
    Determine whether it is an object
  • get_object_vars()
    Get all the attributes of the object and return an array. The subscript is the attribute name

operator

  • new
  • instanceOf determines whether an object is an instance of a certain class (including inheritance)
<code><span><span>class</span><span>bee</span>{</span>}
<span>$o</span> = <span>new</span> bee();
<span>if</span>(<span>$o</span><span>instanceOf</span> bee){
    <span>echo</span><span>'true'</span>;
}</code>
').addClass(' pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above has introduced the system functions and operators of PHP classes and objects, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP 单一入口Next article:PHP之类特性