getting error "Parse error: syntax error, unexpected '$physics' (T_VARIABLE), expecting function (T_FUNCTION) in C:\xampp\htdocs\bookclass.php on line 19"need help pls help me out.
<?php
class Books{
/* Member variables */
public $price;
public $title;
/* Member functions */
function setPrice($par){
$this->price = $par;
}
function getPrice(){
echo $this->price ."<br/>";
}
function setTitle($par){
$this->title = $par;
}
function getTitle(){
echo $this->title ." <br/>";
}
$physics = new Books;
$physics->setTitle( "Physics for High School" );
$physics->setPrice( 10 );
$physics->getTitle();
$physics->getPrice();
}
?>