For the most part, you use $this-> when you're referring to a class member or member function withing the class. Local variable, within the class, don't have the $this->
So - to use $this-> your symbol must be a member of the class
When you create an instance of a class, like
$item = new someclass(); then you access the members using $item->
Think of it as the external replacement for the internal $this->
Outside of the class, however, $this-> doesn't make sense
See here:
PHP 5 Data Types[
^] Classes are referred to as data
objects.