php 中的 $this 和self区别

1.self代表类,$this代表对象
2.能用$this的地方一定使用self,能用self的地方不一定能用$this

静态的方法中不能使用$this,静态方法给类访问的。

猜你喜欢

转载自blog.csdn.net/hua950327/article/details/78168547