PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
LonelyProgrammer
Forum Contributor
Posts: 108 Joined: Sun Oct 12, 2003 7:10 am
Post
by LonelyProgrammer » Wed Jan 21, 2004 1:15 am
Which
output function will be called in the case of the code below?
Code: Select all
class A
{
A() { }
greet() { echo "Greetings from A!"; }
output() { $this->greet(); }
}
class B extends A
{
B() { parent::A(); }
greet() { echo "Greetings from B!"; }
output() { parent::output(); }
}
McGruff
DevNet Master
Posts: 2893 Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland
Post
by McGruff » Wed Jan 21, 2004 2:01 am
The child. Full explanation in the manual.