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 Sanders Kaufman on 07/23/07 04:25

Michael Fesser wrote:

> Quite simple: A base class with a member variable and a method that
> performs some action with that. Since this is done in the constructor,
> every child class has to be able to initialize the data before calling
> the parent constructor, as you can see in B::__construct(). If PHP would
> automatically call the parent constructor, this would be impossible.

So extended (child?) classes MUST NOT (for OOP reasons) automatically
call a constructor. Rather, it should be called manually, if and when
it's desired.

And this is not unique to PHP.

Zat right?

(Scuse me if I'm being dense, but I got some head stuff going on.)

 

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

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