静态方法this
The book tells about static methods but it forgets to mention that you cannot use $this in static methods. A static method is pretty much like a normal stand-alone function is not aware about the object as a whole. So you can call the static method when no object of that class exists. In this case the method would have no idea what $this is.
该书介绍了静态方法,但忘记了您不能在静态方法中使用$ this。 静态方法很像普通的独立函数不了解整个对象。 因此,当该类的对象不存在时,您可以调用静态方法。 在这种情况下,该方法将不知道$ this是什么。
Tell your friends about this post on Facebook and Twitter
在Facebook和Twitter上告诉您的朋友有关此帖子的信息
静态方法this