I am trying to get into php object oriented programming.
<?php
class myClass{
public $myVar="this is demo";
public function myTextdemo(){
echo $myVar;
}
}
$obj= new myClass;
echo $obj->$myVar;
?>
It says
Fatal error: Cannot access empty property on line 11
What's wrong with my code?