RE: [PHP] Re: unsetting an instance from within its class
| From: | Maxim Maletsky | Date: | Thu, 11 Apr 2002 00:45:44 +0000 |
| Subject: | RE: [PHP] Re: unsetting an instance from within its class | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-92477@lists.php.net to get a copy of this message | ||
Class foo {
Var $bar = 'bar';
function baz() {
echo '$this->bar once used to be ' . $this->bar;
unset($this->bar);
echo "<br> ...and not it's not : {$this->bar}";
}
}
$foo = new foo();
unset($foo);
// kill the instance outside the class
Cheers,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
maxim@phpbeginner.com
www.phpbeginner.com
> -----Original Message-----
> From: Ian [mailto:ian.ferger@solveris.com]
> Sent: Thursday, April 11, 2002 2:27 AM
> To: php-general@lists.php.net
> Subject: [PHP] Re: unsetting an instance from within its class
>
> $this
>
> "Erik Price" <pricee@hhbrown.com> wrote in message
> news:A0632096-4C9C-11D6-BC9F-0050E4857868@hhbrown.com...
> > Is there a way to unset or destroy an object instance from a method
> > within its class? I'm trying to write a method that destroys its
> > instance but I'm not sure how to refer to the object itself from
within
> > the class.
> >
> >
> > Erik
> >
> >
> >
> >
> >
> > ----
> >
> > Erik Price
> > Web Developer Temp
> > Media Lab, H.H. Brown
> > pricee@hhbrown.com
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php