Re: Creating Objects!

From: Date: Tue, 23 Sep 2003 11:09:17 +0000
Subject: Re: Creating Objects!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-163569@lists.php.net to get a copy of this message
Well in the first one the property of A named "B" will be an instance of B. In the second one a local variable in the constructor function named "B" which is an instance of B, and that variable will not be accessible from any function other than the constructor (unless you're playing w/ the reflection api, which i sincerely doubt) look up variable scope in the manual. maybe php.net/variable-scope, but im too lazy to check (its 4am here) On Tuesday 23 September 2003 03:44 am, Webmaster wrote: > HI, > > let us say there is Class A. > In the constructor of this class I create an Object B of Class B. > > Now what is the difference between these two ? > > this->B = new B; > > and > > B = new B; > > > Thank you very much! > > Wenmaster

« previous php.general (#163569) next »