$this¶
$this is a variable that represents the current object. It is different in each object, each method.
$this is also called a pseudo-variable. It is never explicitly set, but is available as soon as the method starts.
$this cannot be unset, nor assigned a different value than the current object. This means it cannot be used as an argument, for example.
There is no special variable called $that.
<?php
class X {
private $y = 1;
function foo() {
return $this->y;
}
}
?>
See also https://www.phptutorial.net/php-oop/php-this/, https://medium.com/@erlandmuchasaj/what-is-this-16846fe8c15e