"This function returns the name of the class of which the object obj is an
instance."

The name of the class is "myClass", therefore the behavior is as it should
be.

"thisInstance" is an object, not a class. If you are trying to do something
imparticular you'll have to be more specific.

As for getting the name "thisInstance", I'm not really sure why you'd need
to, so I can't think of a work-around.

Since "thisInstance" is the name of the object, you need some object related
function. I've never had to do it, so I have no clue how, but maybe someone
else will know :)


--
Plutarck
Should be working on something...
...but forgot what it was.


""Boget, Chris"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Given the following code:
>
> -----
>
> class myClass {
>   function myClass() {
>     $classVar = get_class( $this );
>
>   }
> }
>
> $thisInstance = new myClass();
>
> -----
>
> What value should $classVar contain?
>
> "myClass"
>
> or
>
> "thisInstance"
>
> ?
> The documentation leads me to believe that it is the
> latter value, but in practice it contains the former.
> If it is supposed to have the latter value, is there any
> way I can get the fomer?  Any way that I can get the
> name "thisInstance"?
>
> Chris
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to