#21515 [Opn]: debug_backtrace() needs documentation.
| From: | philip@php.net | Date: | Sat, 18 Jan 2003 09:04:12 +0000 |
| Subject: | #21515 [Opn]: debug_backtrace() needs documentation. | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969350989@lists.php.net to get a copy of this message | ||
ID: 21515
Updated by: philip@php.net
-Summary: Show the current functionname
Reported By: gerwout@notenbomer.nl
Status: Open
Bug Type: Documentation problem
Operating System: all
PHP Version: 4.3.0
New Comment:
__FUNCTION__ is now documented as per bug #19196.
Am changing the topic of this bug report to reflect everyones deep
desire for debug_backtrace() to be documented.
We all agreed that the section on "Error Handling and Logging
Functions" is the best place for debug_backtrace.
Previous Comments:
------------------------------------------------------------------------
[2003-01-08 11:22:35] philip@php.net
You can use the __FUNCTION__ constant as of PHP 4.3.0 It's documented
somewhere with the other magical sorta-constants __FILE__, __LINE__,
and __CLASS__. __CLASS__ also became available in PHP 4.3.0
I think there's a bug somewhere for documented these sorta-constants as
the manual doesn't document them very well.
------------------------------------------------------------------------
[2003-01-08 04:27:05] derick@php.net
hah, nu even de daad by het woord voegen :-)
------------------------------------------------------------------------
[2003-01-08 04:26:25] derick@php.net
You can use debug_backtrace() for this (which is new in PHP 4.3.0).
(Try var_dump(debug_backtrace()); to see what output it gives), marking
this bug as a doc problem, as debug_backtrace() has not been documented
yet.
Derick
------------------------------------------------------------------------
[2003-01-08 04:20:36] gerwout@notenbomer.nl
Is it possible to create a getCurrentFunctionName() function?
If an user defined error occured (for example: you are not getting a
valid SQL-resultset with your query) in a function, it would be handy
to show the functionname where the error is generated.
Possible example:
function getQueryResultSet() {
// requested code
$currentFunctionName = getCurrentFunctionName();
$query="select * from table";
$result = mysql_query($query) or die ("The error occured in ".
$currentFunctionName);
return $result;
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21515&edit=1