Mega Code Archive
Three levels of inheritance
name = $name;
}
function getName() {
return "My name is ".$this->name."
";
}
}
class Executive extends Employee {
function methodB() {
echo " my yacht!";
}
}
class CEO extends Executive {
function methodC() {
echo "tuck";
}
}
$ceo = new CEO();
$ceo->setName("Joe");
$ceo->methodB();
$ceo->methodC();
?>