The example parses the PHPextends class inheritance. PHPextends class inheritance code example :? Phpclassa {public $ x; public $ y; function _ construct ($ x0, $ y0) {$ this-x $ x; $ this-y $ y;} functiongetx () {return $ this-x;} functio
PHP extends class inheritance code example:
- <? Php
- Class {
- Public $ x;
- Public $ y;
- Function _ construct ($ x = 0, $ y = 0 ){
- $ This->X = $ x;
- $ This->Y = $ y;
- }
- Function getx (){
- Return $ this->X;
- }
- Function gety (){
- Return $ this->Y;
- }
- Function _ destruct (){}
- }
- Class a2 extends {}
/* Extends is an inherited function */
- $ B2 = new a2 (10, 10 );
- Echo $ b2->Getx ()."
";
- Echo $ b2->Gety ();
- ?>
The above describes all the implementation steps of the PHP extends class inheritance.
Http://www.bkjia.com/PHPjc/446027.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/446027.htmlTechArticlePHP extends class inheritance code example :? Php classa {public $ x; public $ y; function _ construct ($ x = 0, $ y = 0) {$ this-x = $ x; $ this-y = $ y;} functiongetx () {return $ this-x;} functio...