Last active
July 15, 2020 15:07
-
-
Save ulcuber/96da75418c1cd877408af74c8274a9fb to your computer and use it in GitHub Desktop.
Laravel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Usage: dumpBacktrace(debug_backtrace(), 3); | |
*/ | |
function dumpBacktrace($b, int $count = null): void | |
{ | |
$count = is_int($count) ? $count : count($b); | |
for ($i = $count - 1; $i >= 0; --$i) { | |
dump(($b[$i]['class'] ?? '') . '@' . $b[$i]['function']); | |
} | |
dump(''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment