Re: [PHP4BETA] Self-referencing variables revisited
| From: | Andrei Zmievski | Date: | Tue, 28 Mar 2000 14:22:54 +0000 |
| Subject: | Re: [PHP4BETA] Self-referencing variables revisited | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-12735@lists.php.net to get a copy of this message | ||
On Mon, 27 Mar 2000, Gary Bickford wrote:
> 3. I just came up with this one, related to the last. If nameof()
> were a part of the language, then classes could have the ability to
> provide more useful error reporting, without explicit names in the
> code. Thus, one might have
> printf ("%s: Error %d - %s\n",nameof ($this), $this->errnum,
> $this->errstring)
>
> It appears to me that nameof() brings up the whole question of
> introspection...
Use get_class_name($object).
-Andrei
"Music expresses that which can not be said
and on which it is impossible to be silent."
-Victor Hugo