There is a big difference:
$this->a refers to the $a property of your class
$this->$b on the other hand, refers to a property by name, which is stored in the variable $b as a string:
$b = "a"; $this->$b equals $this->a $b = "hello" $this->$b equals $this->hello
source share