Reply to Re: How to force a variable to be a custom object?

Your name:

Reply:


Posted by Alex Gemmell on 09/02/05 16:05

Norbert Wenzel wrote:
> I don't know if this works in PHP4, but I would suggest to clear this in
> your constructur. But I don't know if this is always called in PHP4.
>
> class myClass {
>
> var $object;
>
> myClass() {
>
> $this->object = new OtherObject();
>
> }
> }
>
> This isn't really forced, since you could change $object from outside
> the class. If there is a way you should declare $object private. That's
> not stylish, but I guess it works.

I think PHP5 deals with private/public variables and all that gaff.
PHP4 doesn't quite offer OO that well, but good enough if you strictly
use your Class message interfaces!

Thanks for the help Norbert. You're right - that would pretty much do
the trick.

Alex

[Back to original 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

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