This paper summarizes the PHP class and object-related system functions and operators. Share to everyone for your reference, specific as follows:
System functions
Class_exists () |
To determine whether a class exists |
Interface_exists () |
To determine if an interface exists |
Get_class ()/__class__ |
Gets the name of the class where an object is |
Get_parent_class () |
Gets the class name of the parent class to which an object belongs |
Get_class_methods () |
Gets a class all methods, returning an indexed array |
Get_class_vars () |
Gets all the properties of a class, labeled as the property name |
Get_declared_classes () |
Get all declared classes (including system classes) |
Is_object () |
Judge whether the object |
Get_object_vars () |
Get all properties of object, return array, subscript as property name |
Property_exists () |
Determine if the property exists in the object |
__method__ |
Get Method Name |
__function__ |
Get the name of the letter |
Operator
New |
Instantiating an Object |
instanceof |
An instance that determines whether an object is a class (including inheritance) |
Class bee{}
$o = new Bee ();
if ($o instanceof Bee) {
echo ' true ';
}
More about PHP Interested readers can view the site topics: "PHP object-oriented Program Design Primer", "PHP operation and operator Usage Summary", "PHP basic Grammar Introductory Course", "PHP Network Programming Skills Summary", "PHP Array" operation Skills Encyclopedia, " Summary of PHP string usage, Introduction to PHP+MYSQL database operations, and a summary of PHP common database operations Tips
I hope this article will help you with the PHP program design.