Sho*_*hoe 2 php oop abstract-class
abstract class Ghost {
protected static $var = 'I\'m a ghost';
final public static function __callStatic($method, $args = array()) {
echo self::$var;
}
}
class Person extends Ghost {
protected static $var = 'I\'m a person';
}
Run Code Online (Sandbox Code Playgroud)
的调用Person::whatever()将打印:I'm a ghost。为什么?