I see code using the variable $this quite often. For example, it might refer to something as:
$this->$source = preg_replace($pattern, $replacement, $string);
I understand preg_replace. I'm just not sure about $this->$source.
$this refers to the current instance (object) of the class in which that code exists (in one of that class's methods).
NogDog;11047581 wrote:$this refers to the current instance (object) of the class in which that code exists (in one of that class's methods).
$this 😃
http://php.net/manual/en/language.oop5.basic.php