oop - What is the difference between self and $this in php? -


this question has answer here:

what difference between $this , self? when should use each of them?

$this refers current instance. self refers current class.

in other words, can use $this->somemember refer instance member , self::$somestaticmember refer static member.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -