【发布时间】:2012-03-23 14:15:26
【问题描述】:
我正在尝试在不需要子类上的函数的情况下完成此操作...这可能吗?我有一种感觉不是,但我真的很想确定......
<?php
class A {
public static function who() {
echo __CLASS__;
}
public static function test() {
static::who(); // Here comes Late Static Bindings
}
}
class B extends A {
public static function who() {
echo __CLASS__;
}
}
B::test(); //returns B
?>
【问题讨论】:
标签: php oop php-5.3 late-static-binding