//static//normal member//normal member is a//static member///static member belongs to the class//keyword: static//self keyword: In the class represents the class//In the static method cannot call the ordinary member//in the ordinary method can call static member//.$ This represents the object that needs to be called with the object and cannot be called with the class name! Illustrates a situation in which a normal member cannot be called in a static methodclassfenbi{ Public $length;//the length of the chalk Public Static $color;//the color of the chalk Static functionShow () {Echo"Chalk color is:". Self::$color; } functionXianshi () {Echo"Show:". Self::$color; }}$f=NewFenbi ();//create an object first$f->length;//use objects to invoke ordinary membersFenbi::$color= "Red";//calling a static member using the class nameFenbi::Show ();$f-Xianshi ();//Abstract//abstract class: Keyword abstract//features: Can not be instantiated, can only be inherited//purpose: In order to derive subclasses, the control sub-classAbstract classdog{ Public $name; functionJiao () {EchoBarking; }}classJinmaoextendsdog{}//$d = new Dog ();//interface///interface cannot contain member variables, only member methods//Member methods can have no function body//interface keyword: interface//implements the interface class, must implement all the methods inside the interfaceInterfaceiusb{functionRead ();//Read the method functionWrite ();//How to write}//Mouse Driver ClassclassMouseImplementsiusb{functionRead () {Echo"Mouse clicked"; } functionwrite () {Echo"Give the Mouse an instruction"; }}//driver classes for keyboardsclassJianpanImplementsiusb{functionRead () {Echo"Keyboard entered the content"; } functionwrite () {Echo"Give keyboard Instructions"; }}$m=NewMouse ();$m-write ();$j=NewJianpan ();$j-read ();//Interface: API
Static, keyword: static interface, IUSB, API interface keyword: interface