类继承 [英] Class inheritance
本文介绍了类继承的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在PHP4中获得多个继承?例如,我有
3个父类,A,B和C类。我希望类X继承所有这3个
类。考虑合并这3个类是不可能的,因为
是Y类,它只继承自A类等。
TIA
Hi,
Are there any ways to get multiple inheritace in PHP4? For example, I have
3 parent class, class A, B, and C. I want class X to inherit all those 3
classes. Consider merging those 3 classes is out of the question, as there
are class Y which only inherits from class A, etc.
TIA
推荐答案
Ricky Romaya写道:
Ricky Romaya wrote:
有没有办法在PHP4中获得多个继承?例如,我有3个父类,A,B和C类。我希望类X继承所有这3个类。考虑合并这3个类是不可能的,因为那里是Y类,它只继承自A类等。
TIA
Hi,
Are there any ways to get multiple inheritace in PHP4? For example, I have
3 parent class, class A, B, and C. I want class X to inherit all those 3
classes. Consider merging those 3 classes is out of the question, as there
are class Y which only inherits from class A, etc.
TIA
是的 - 查看对象聚合(主要是4.2+)
http://us2.php.net/manual/en/ref.objaggregation.php
- Dwayne
Yep - check out Object Aggregation (mostly 4.2+)
http://us2.php.net/manual/en/ref.objaggregation.php
- Dwayne
" Ricky Romaya" <所以******* @ somewhere.com>在消息中写道
news:Xn ******************************** @ 66.250.146 .159 ...
"Ricky Romaya" <so*******@somewhere.com> wrote in message
news:Xn********************************@66.250.146 .159...
有没有办法在PHP4中获得多个继承?例如,我有3个父类,A,B和C类。我希望类X继承所有这3个类。考虑合并这3个类是不可能的,因为那里是Y类,它只继承自A类等。
TIA
Hi,
Are there any ways to get multiple inheritace in PHP4? For example, I have
3 parent class, class A, B, and C. I want class X to inherit all those 3
classes. Consider merging those 3 classes is out of the question, as there
are class Y which only inherits from class A, etc.
TIA
种类。例如:
A级{
var
Kind of. Example:
class A {
var
a;
函数A(
a;
function A(
这篇关于类继承的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文