Reply to Re: syntax? how to declare a member of a class which is itself a class

Your name:

Reply:


Posted by ZeldorBlat on 08/23/07 15:17

On Aug 23, 11:06 am, D_a_n_i_e_l <danwgr...@gmail.com> wrote:
> how to declare a member of a class which is itself an object?
>
> class cA
> {
> private $blah;
> public function foo()
> {
> return $blah;
> }
>
> }
>
> class cB
> {
> private cA $a; // I want this to be of type class A
>
> }

Class members don't have a type specified. They'll take on the type
of whatever you put in them -- so there's no need to declare it
explicitly (nor is there syntax to do so).

[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

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