<?php header("content-type:text/html;charset=utf-8"); class a{ public function call(){ echo "父类的".__CLASS__; } public static function say(){ self::call();//直接在父类中调用call方法 } public static function say1(){ static:: call();//延迟绑定到b的call方法 } } class b extends a{ public function call(){ echo "子类的".__CLASS__; } } b::say();//父类的a b::say1();//子类的b
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/15110.html