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)
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
>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
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
4 matches
Mail list logo