现在位置: 首页 > new static new self 区别 使用
2020年02月20日 数据库 ⁄ 共 737字 评论关闭
下面我们举个栗子: 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...
阅读全文