码迷,mamicode.com
首页 > 其他好文 > 详细

温故而知新

时间:2016-11-04 23:47:03      阅读:331      评论:0      收藏:0      [点我收藏+]

标签:axis   bar   kth   技术分享   orb   rbd   ued   dsd   dha   

技术分享

 

 1 <?php
 2 /**
 3  * User: szliugx@gmail.com
 4  * Date: 2016/11/4
 5  * Time: 21:53
 6  */
 7  
 8 class Atest
 9 {
10     public static $testnum = 0;
11     /**
12     A方法    
13     */
14     public function Afun()
15     {
16         self::$testnum += 2;
17         echo self::$testnum."<br/>";
18     }
19 }
20 
21 class Btest extends Atest
22 {
23     public static $testnum = 0;
24     /**
25     B方法    
26     */
27     public function Bfun()
28     {
29         echo parent::$testnum."<br/>";
30         echo self::$testnum."<br/>";
31     }
32 
33 }
34 
35 $atest = new Atest();
36 $atest->Afun();
37 $atest = new Atest();
38 $atest->Afun();
39 $btest = new Btest();
40 $btest->Bfun();

 

 

 

 

2

4

4

0

温故而知新

标签:axis   bar   kth   技术分享   orb   rbd   ued   dsd   dha   

原文地址:http://www.cnblogs.com/liugx/p/6031839.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!