I have several classes (a, b, c and so on) that extends an abstract class called mother. All the "sons" use the method "save":
<?php
class mother {
public function save() {
echo "Mother saves!
";
debug_print_backtrace();
}
}
class a extends mother {
public function save() {
echo "Calling save from A
";
parent::save();
}
}
$test = new a;
$test->save();
?>
If you run this code, the result of debug_print_backtrace is very clean and it is exactly what I need:
#0 mother->save() called at [/home/xfiddlec/public_html/main/code_44364601.php:13] #1 a->save() called at [/home/xfiddlec/public_html/main/code_44364601.php:18]
The problem is, if you are using a framework (Im using Zend2), the stack trace is over a 1MB, a huge string. If there a way I can limit the trace coverage? For my application having the file, the line and the name of the class that extended mother is good enough.