php-general | 2001092

[PHP] Re: &$this? From: Ming-Chieh Lee (ming <email protected>)
Date: 09/26/01

just for clarity, why do we need to reference a variable when the variable
already contain a reference? Thanks

"Ming-Chieh Lee" <ming <email protected>> wrote in message
news:20010926192541.25232.qmail <email protected>
> does anyone know what does &$this mean? I saw this on the php.net
> > tuturial
> > > for references inside a constructor.
> > > I thought that $this is already a reference?
> > > The way it was used :
> > > class Foo
> > > {
> > > function Foo($name)
> > > {
> > > // create a reference inside the global array $globalref
> > > global $globalref;
> > > $globalref[] = &$this;
> > > // set name to passed value
> > > $this->setName($name);
> > > // and put it out
> > > $this->echoName();
> > > }
> > > thanks for any input!
>
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>