标签为 [PHP中static与self] 的文章

PHP中static与self

一直搞不清楚,今天百度自己也测试了一下。 <?php class A { public static function closure(){ echo __CLASS__."<br/>"; } public static function call_self(){ static::closure(); } public static function call_static(){ self::closure(); } } class B extends A { public static function closure(){ echo __CLASS__."<br/>"; } } A::call_self();//A A::call_static();//A B::call_self();//A B::call_static();//B 百度是这样说 ......
百度统计