note 101607 rejected from language.constants.predefined by danbrown
| From: | danbrown@php.net | Date: | Tue, 04 Jan 2011 14:44:26 +0000 |
| Subject: | note 101607 rejected from language.constants.predefined by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-175443@lists.php.net to get a copy of this message | ||
Note Submitter: daevid at daevid dot com
----
There needs to be more of these magic constants.
__INVOKING_FUNCTION__ -- what function called *this* function
__INVOKING_FILE__ -- what file called this file.
etc.
For example, I have a database wrapper. Everything in my code calls it. I want to prefix the
filename and function that called my sql_query() function. But If I use the __FILE__ and
__FUNCTION__ I always get back "db.inc.php" and "sql_query()" every time. Not
very useful.
The only other current option is to use the "backtrace()" call and parse that out every
time which is tedious and slow.