Code:
<?phpclass Ice {
function myFun() {
return "Ice";
}
}
class Cream extends Ice {
function myFun() {
return "Cream";
}
}
$ice = new Ice;
$cream = new Cream;
echo "<center><h1>Function Overriding</h1>";
echo($ice->myFun());
echo($cream->myFun());
echo "</center>";
?>