Re: Name of Class' instance

From: Date: Wed, 07 Feb 2001 04:22:57 +0000
Subject: Re: Name of Class' instance
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38487@lists.php.net to get a copy of this message
"Boget, Chris" <Chris.Boget@wild.net> wrote: > So if you do: > > $joeBob = new myClass(); > > "myClass" can somehow know that "joeBob" is the name of > it's instance? > > I'm thinking 'no', but would like verification. I'm not aware of a way to do so. I'm curious why you'd want to? If you want to pass "joeBob" to the class you can do so as the parameter of one of the methods. And my guess is that you already know, but if you want to refer to a method or property of a class from within the class, you do using syntax like $this->property_here. -- Steve Werby COO 24-7 Computer Services, LLC Tel: 804.817.2470 http://www.247computing.com/

« previous php.general (#38487) next »