$ is a special variable, and it refers to the same object, i.e. by itself.
it really refers to an instance of the current class
here is an example that will clear the above statement
<?php class Books { var $price; var $title; function setPrice($par){ $this->price = $par; } function getPrice(){ echo $this->price ."<br/>"; } function setTitle($par){ $this->title = $par; } function getTitle(){ echo $this->title ." <br/>"; } } ?>
homi Mar 26 '16 at 7:20 2016-03-26 07:20
source share