Mega Code Archive
The Method of a Child Class Overriding That of Its Parent
The Method of a Child Class Overriding That of Its Parent
name = $n;
}
function sayHello(){
print "Hello my name is $this->name
";
}
}
class second_class extends FirstClass {
function sayHello(){
print "say hi
";
}
}
$test = new second_class("new name");
$test->sayHello();
?>