// A is the core class
class A{
public $lang;
function sayhi($name){echo "Hi".$name;}
function speak(){echo "Can Speak".$this->lang;}
}
class B {
function TODO(){
echo " Go to work ";
}
}
I DID for now like this:
class C extends B {
function TODO(){
//more implement here
$a = new A();// here I created an instance.
// do any actions for A
$a->sayhi("Newbie");
}
}
BUT I want to class B have all the construct of class A?
so when I DO on class C (just something like this)
class C extends B {
function TODO(){
//more implement here
// I wish I can
sayhi("Newbie");
}
}
Anybody could tell me how can implement this?
1 Answer