Skip to content

Instantly share code, notes, and snippets.

@emersonbroga
Created September 25, 2015 18:26
Show Gist options
  • Save emersonbroga/84b66a3ef8dccd116728 to your computer and use it in GitHub Desktop.
Save emersonbroga/84b66a3ef8dccd116728 to your computer and use it in GitHub Desktop.
dd.php Debug and die.
function dd() {
$separator = (php_sapi_name() === 'cli') ? PHP_EOL : '<br/>';
$bt = debug_backtrace();
$caller = array_shift($bt);
$args = func_get_args();
call_user_func_array('var_dump', $args);
die($caller['file'] .':'. $caller['line'] . $separator);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment