Re: &$this?
| From: | Ming-Chieh Lee | Date: | Wed, 26 Sep 2001 19:27:21 +0000 |
| Subject: | Re: &$this? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-68911@lists.php.net to get a copy of this message | ||
just for clarity, why do we need to reference a variable when the variable
already contain a reference? Thanks
"Ming-Chieh Lee" <ming@thesmartport.com> wrote in message
news:20010926192541.25232.qmail@pb1.pair.com...
> 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!
>
>
>