class A {
public static function foo() {
static::who();
}
public static function who() {
echo __CLASS__."\n";
}
}
class B extends A {
public static function test() {
A::foo();
parent::foo();
self::foo();
}
public static function who() {
echo __CLASS__."\n";
}
}
class C extends B {
public static function who() {
echo __CLASS__."\n";
}
}
C::test();
输出结果为ACC.我的疑问是为什么第二个是C而不是B?还请各位大神赐教
炎炎设计
30秒到达战场
慕盖茨4494581