Add debug_tracer.php
This commit is contained in:
parent
e652df627f
commit
4487730549
15
debug_tracer.php
Normal file
15
debug_tracer.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
// Вставить в начало любого метода чтобы отследить откуда он вызывается.
|
||||
|
||||
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 5);
|
||||
|
||||
foreach ($trace as $i => $frame) {
|
||||
$file = $frame['file'] ?? '[internal]';
|
||||
$line = $frame['line'] ?? '?';
|
||||
$func = $frame['function'] ?? '?';
|
||||
$class = $frame['class'] ?? '';
|
||||
$type = $frame['type'] ?? '';
|
||||
|
||||
echo "#$i $file:$line $class$type$func()\n";
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user