How does multilevel inheritance implemented in PHP?
How is multilevel inheritance implemented in PHP using PHP mag开发者_Go百科ic methods?
I was asked in an interview "how will you implement multilevel inheritance using magic methods".
So I am eager to know about this.
Thx.
It's not clear whether you mean "how does one use multilevel inheritance?" or "how is it implemented inside the PHP interpreter?". If it's the former, then as follows:
class Animal
{
...
}
class Cat extends Animal
{
...
}
class Tiger extends Cat
{
...
}
If it's the latter, then I'm not sure it's possible to give a reasonable explanation in a few paragraphs here!
精彩评论