Last active
August 29, 2015 14:10
-
-
Save tucq88/7e8652ccd84eb0cef141 to your computer and use it in GitHub Desktop.
Snippet - PHP
This file contains 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
function debug($var) { | |
echo '<pre style="text-align: left;font-size: 14px;">'; | |
$trace = debug_backtrace(); | |
echo 'Line: ' . $trace[0]['line'] . '<br>'; | |
print_r($var); | |
echo '</pre>'; | |
} | |
function debug_plus() | |
{ | |
$args = func_get_args(); | |
$trace = debug_backtrace(); | |
foreach($args as $k => $arg){ | |
echo '<fieldset class="debug"> | |
<legend>(' . ($k+1) . ') Line : ' . $trace[0]['line'] . '</legend>'; | |
print_r($arg); //Yii : CVarDumper::dump($arg, 10, true); | |
echo '</fieldset>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment