You are here: Re: Using a Resource as a Class Property « PHP Programming Language « IT news, forums, messages
Re: Using a Resource as a Class Property

Posted by Toby A Inkster on 07/23/07 14:45

Sanders Kaufman wrote:

> Parent. Parents. Hmmm. That takes me to a new question - I understand
> that a PHP class be an extension of more than one parent class.
> (e.g. "class myClass extends oMommy, oDaddy")

You understand differently to me then. This is called "multiple
inheritance" and very few OO languages support it.

You can inherit from more than one class like this:

class A {}
class B extends A {}
class C extends B {} /* and thus A */

but not like this:

class A {}
class B {}
class C extends A, B {}

If you use interfaces, you can write a class that implements multiple
interfaces:

interface A {}
interface B {}
class A implements A, B {}

and that is fine. (Same story with Java.)

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 32 days, 18:20.]

Parsing an HTML Table with PEAR's XML_HTTPSax3
http://tobyinkster.co.uk/blog/2007/07/20/html-table-parsing/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация