RE: [PHP] Deleting Objects

2003-04-02 Thread John Coggeshall
ll Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Deleting Objects Not exactly true. unset() destroys the reference to the value, not the value itself. For instance, error_reporting(E_ALL); $var1 = "foo"; $var2 = &$var1; print "$var1\n$var2\n\n"; unset($var1)

Re: [PHP] Deleting Objects

2003-04-02 Thread Leif K-Brooks
Not exactly true. unset() destroys the reference to the value, not the value itself. For instance, error_reporting(E_ALL); $var1 = "foo"; $var2 = &$var1; print "$var1\n$var2\n\n"; unset($var1); print "$var1\n$var2"; will output: foo foo Notice: Undefined variable: var1 in PHPDocument1 on li

RE: [PHP] Deleting Objects

2003-04-02 Thread John Coggeshall
>How does one delete an object? For example: > > $object = new Class(...); > . > $object = new Class(...); PHP deletes any variable which is no longer referenced in memory.. So in this case the first object that the variable $object pointed to will automatically be destroie

Re: [PHP] Deleting Objects

2003-04-02 Thread Leif K-Brooks
That will work perfectly. [EMAIL PROTECTED] wrote: How does one delete an object? For example: $object = new Class(...); . $object = new Class(...); I want to throw away the old object and create a new, freshly initialized one using the same variable. Is the above