Forked from mathiasgrimm/gist:8ba480eb5008fc84e8ba
Last active
August 29, 2015 14:15
-
-
Save nicholasruunu/a01f0db119515d8f2e5d to your computer and use it in GitHub Desktop.
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
if ( ! function_exists('dd')) | |
{ | |
/** | |
* Dump the passed variables and end the script. | |
* | |
* @param mixed | |
* @return void | |
*/ | |
function dd() | |
{ | |
$backtrace = debug_backtrace()[0]; | |
$fileInfo = 'File: ' . $backtrace['file'] . ':' . $backtrace['line'] . PHP_EOL; | |
echo PHP_SAPI === 'cli' ? $fileInfo : nl2br($fileInfo); | |
array_map(function($x) { var_dump($x); }, func_get_args()); die; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment