Summary of PHP class and object-related system functions and operators

Source: Internet
Author: User
Tags php class
This article mainly introduces the PHP class and object-related system functions and operators, combined with examples to summarize and analyze the PHP class and object operation process commonly used in system functions and operators, the need for friends can refer to the following

This article summarizes the PHP class and object-related system functions and operators. Share to everyone for your reference, as follows:

System functions

Class_exists () Determine if a class exists
Interface_exists () Determine if an interface exists
Get_class ()/class Gets the class name where an object is located
Get_parent_class () Gets the class name of the parent class to which an object belongs
Get_class_methods () Get all methods of a class, return an indexed array
Get_class_vars () Get all properties of a class, subscript as property name
Get_declared_classes () Get all declared classes (including system classes)
Is_object () Determine if the object
Get_object_vars () Get all properties of the object, return an array, subscript the property name
Property_exists () Determine if the property exists in the object
METHOD Get Method Name
FUNCTION Get the name of a function

Operator

New Instantiate an Object
instanceof Determines whether an object is an instance of a class (including inheritance)
Class bee{} $o = new Bee (), if ($o instanceof Bee) {echo ' true ';}
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.