Re: reference
| From: | Roel Vanhout | Date: | Fri, 11 May 2001 11:43:43 +0000 |
| Subject: | Re: reference | ||
| References: | 1 | Groups: | php.gtk |
| Request: | Send a blank email to php-gtk+get-1804@lists.php.net to get a copy of this message | ||
On Fri, May 11, 2001 at 12:25:45PM +0200, Peto Kmet wrote:
> sorry for off-topic but, what is the difference between
> variable assigned by reference (&)
> $window = &new GtkWindow();
> and without it:
> $window = new GtkWindow();
> If I tried it and at first sight it makes no diference but I know there
> is. So what it is ?
Without the reference, an instance of the object will be made, and a
copy of this object will be assigned to $window. With the reference,
only one instance will be made. So, the version with the reference is
more memory efficient.
cheers,
roel