1, inheritance extends can only be inherited by single
Public protected Private Property
__construct ()
__destruct ()
__get () Read Private member
__set ($n, $v) set private members
2, access the parent class function:: (also called a scope character in C + +)
7
3, overloading functions with the same name as the parent class
4, abstract classes must inherit an abstract function that cannot be instantiated and must be overridden as long as a function in the class is static, then the class must be static
5, Common keywords
1,final when defining a class, a class cannot be inherited when a function cannot be overloaded
2,self used to access properties in an instantiated class or methods (static or constant) using the method self:: Property
3,static defines a static member or method only occurs once in memory (non-static content cannot occur within a static method)
4,const constants that define constants that can only be decorated with member properties are not added $
6, application of Interface interface interface Definition keyword implements reference
Interfaces: All abstract methods, without the abstract attribute should be a constant
Interface demo{}
Class T implements demo{} can refer to multiple interfaces
First inherit after interface Class A extends root implements demo{}
Interface inheritance Interface interface D extends Demo
7, polymorphic PHP is a weakly typed language, so support is not perfect.
Instanceof Tests whether an instance is from a class example:a{} $c = new A; if ($c instanceof a)
8, when the object is passed as a parameter to the function, the constructor is not run and is not a replica, but the object address is passed
9, Object Description configuration __tostring () {content} direct Echo Object
10, object exception handling __call ($name, $value) automatically absorbs your error when calling a nonexistent method name and displays the values of the $name and error parameters
11, Object clone __clone () put in class clone keyword (equivalent to C + + copy function)
12, Auto Load function __autoload ($class _n) {
Include ($class _n. ' php ');
Automatically load Inlcude () a class when you new class by itself
http://www.bkjia.com/PHPjc/320986.html www.bkjia.com true http://www.bkjia.com/PHPjc/320986.html techarticle 1, inheritance extends can only inherit public protected private property __construct () __destruct () __get () read Private member __set ($n, $v) set Private member 2 to access the parent class function:: (c + + ...