what does $this mean within a class definition? [closed]

好久不见. 提交于 2019-12-01 23:40:25
Gordon

Please see the PHP Manual on Classes and Objects. $this refers to the object instance. Also see these questions:

For array($this,'some_function') see the PHP manual on callbacks. In methods and functions that do accept callbacks, like call_user_func, it means call the method some_function on $this. See

Marking this as CW because it's not meant as an answer but the reason for closevoting as duplicate

$this is a class pointer. $this in class give access to class properties and methods.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!