new self()和new static()的区别体现在继承的类中:
在继承类中调用new static()所在方法会实例化当前类,
在继承类中调用new self()所在方法会实例化new self()方法所在类
new self() 和 new static() 的区别
最新推荐文章于 2022-05-12 17:40:51 发布
new self()和new static()的区别体现在继承的类中:
在继承类中调用new static()所在方法会实例化当前类,
在继承类中调用new self()所在方法会实例化new self()方法所在类