I tried to run this code on xampp and also on codepad and it seems it is not compiling at all.
<?php
class MyName{
public $name="johnh";
public $lastname="doe";
public function setProperty($var_name,$var_lastname){
$this->name=$var_name;
$this->lastname=$var_lastname;
}
public function getProperty(){
return $this->name. " ". $this->lastname;
}
}
$obj=new MyName();
$obj->setProperty("jane","doe");
$obj->getProperty();
?>
Is there anything wrong with the code?