note 69854 added to function.debug-backtrace
| From: | icefragment at gmail dot com | Date: | Sat, 23 Sep 2006 16:34:18 +0000 |
| Subject: | note 69854 added to function.debug-backtrace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-117471@lists.php.net to get a copy of this message | ||
A simple python-like backtrace. Note that I don't recurse into arrays if they are passed as
arguments to functions.
function backtrace()
{
$bt = debug_backtrace();
echo("<br /><br />Backtrace (most recent call last):<br /><br
/>\n");
for($i = 0; $i <= count($bt) - 1; $i++)
{
if(!isset($bt[$i]["file"]))
echo("[PHP core called function]<br />");
else
echo("File: ".$bt[$i]["file"]."<br />");
if(isset($bt[$i]["line"]))
echo(" line
".$bt[$i]["line"]."<br />");
echo(" function called:
".$bt[$i]["function"]);
if($bt[$i]["args"])
{
echo("<br /> args: ");
for($j = 0; $j <= count($bt[$i]["args"]) - 1; $j++)
{
if(is_array($bt[$i]["args"][$j]))
{
print_r($bt[$i]["args"][$j]);
}
else
echo($bt[$i]["args"][$j]);
if($j != count($bt[$i]["args"]) - 1)
echo(", ");
}
}
echo("<br /><br />");
}
}
----
Server IP: 64.71.164.2
Probable Submitter: 69.37.102.10
----
Manual Page -- http://www.php.net/manual/en/function.debug-backtrace.php
Edit -- https://master.php.net/note/edit/69854
Del: integrated -- https://master.php.net/note/delete/69854/integrated
Del: useless -- https://master.php.net/note/delete/69854/useless
Del: bad code -- https://master.php.net/note/delete/69854/bad+code
Del: spam -- https://master.php.net/note/delete/69854/spam
Del: non-english -- https://master.php.net/note/delete/69854/non-english
Del: in docs -- https://master.php.net/note/delete/69854/in+docs
Del: other reasons-- https://master.php.net/note/delete/69854
Reject -- https://master.php.net/note/reject/69854
Search -- https://master.php.net/manage/user-notes.php