What are the difference between self and $this in PHP?
|The “self” command can be used as a static function.||The $this command cannot be used as a static function.|
|Self:: is used to access class variables and other methods||The $this-> is used to access class variables and methods within.|
|It does not need an instantiated object.||It does need an instantiated object.|
Suggest An Answer
No suggestions Available!