Howdy guys, just a note really - The ['args'] data within the resulting array is supplied by reference. I found myself editing the reference unknowingly which in turn shows its ugly head further down the line if you call multiple backtrace.
<?php
$trace = array_reverse(debug_backtrace());
$la = 0;
$lb = count($trace);
while ($la<$lb){
$trace[$la]['file'];
$trace[$la]['line'];
$trace[$la]['args'];
$trace[$la]['function'];
$ba = 0;
$bb = count($trace[$la]['args']);
while ($ba<$bb){
$trace[$la]['args'][$ba] = "EDITING A REFERENCE/POINTER";
$ba++;
}
unset($bb);
unset($ba);
$la++;
}
unset($lb);
unset($la);
?>