标签:
<?php
class Human
{
public static function whoami()
{
echo "来自父类的whoami";
}
public static function say()
{
self::whoami() ;//子类中没有say,找到了父类
}
public static function say2()
{
static::whoami();
}
}
class Stu extends Human{
public static function whoami()
{
echo "来自子类的Whoamid执行";
}
}
Stu::say(); //结果:来自父类的whoami
echo "<br/>";
Stu::say2(); //结果:来自子类的Whoamid执行
标签:
原文地址:http://www.cnblogs.com/yangyuqiu/p/5105092.html