i am trying to access parent class property from child class, i declared a parent class person, a child class college and made an object Ram of college.It gives error help please:
class Person
{
public $name="My name is Ram Singh.";
}
class college extends Person
{
function __construct()
{
echo"Hello college constructor";
}
var $message=$this->name ;
}
$Ram = new college;
echo $Ram->message;
echo $Ram->name;