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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php