Mega Code Archive
Define an Executive class that inherits Employee
name = $name;
}
function getName() {
return "My name is ".$this->name."
";
}
}
class Executive extends Employee {
function pillageCompany() {
echo "I'm selling company assets to finance my yacht!";
}
}
$exec = new Executive();
$exec->setName("R");
echo $exec->getName();
$exec->pillageCompany();
?>