开发者

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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜