| 
 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).
 
  
Navigation:
[Reply to this message] 
 |