To expand on what was explained before:
When using $this-> within a class definition for OOP, you are telling the system to reference the specific instance of a class rather than the actual function itself. For instance:
<?php
class Bar {
var $text;
function HelloWorld() {
echo $this->text;
}
}
$Foo = new Bar;
$Foo->text = "Hello, World! <br>";
$Foo2 = new Bar;
$Foo2->text = "Goodbye, World! <br>";
$Foo->HelloWorld();
$Foo2->HelloWorld();
?>
In the code above, we created two instances of the same class. When we called the HelloWorld() function for each class, the $this->text keyword replaced "$this" with the corresponding class name ($Foo and $Foo2).