This question already has an answer here:
I am using Netbeans editor. I initialize a constructor method in my class
class test {
public $prop= 'i am class property';
public function _construct(){
echo 'hello class"', __CLASS__, '" is initiated';
}
public function setname($newvar){
$this->prop=$newvar;
}
public function getname(){
return $this->prop."</br>";
}
}
$obj = new test ;
echo $obj->getname();
My _construct
method is not working not giving output of class name
</div>