Skip to content

Instantly share code, notes, and snippets.

@ulcuber
Last active July 15, 2020 15:07
Show Gist options
  • Save ulcuber/96da75418c1cd877408af74c8274a9fb to your computer and use it in GitHub Desktop.
Save ulcuber/96da75418c1cd877408af74c8274a9fb to your computer and use it in GitHub Desktop.
Laravel
<?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