Calling an Overridden Method
class FirstClass{
var $name = "Joe";
function FirstClass( $n ) {
$this->name = $n;
}
function sayHello() {
print "my name is $this->name
";
}
}
class second_class extends FirstClass {
function sayHello() {
print "calling method from parent class -- ";
FirstClass::sayHello();
}
}
$test = new second_class("sub class");
$test->sayHello();
?>