下面我们举个栗子:
class Father { public static function getSelf() { return new self(); } public static function getStatic() { return new static(); }} class Son extends Father {} echo get_class(Son::getSelf()); // Fatherecho get_class(Son::getStatic()); // Sonecho get_class(Father::getSelf()); // Fatherecho get_class(Father::getStatic()); // Father
new self
这里面注意这一行 get_clas...
new static new self 区别 使用阅读全文