Last active
August 29, 2015 14:25
-
-
Save mcabreradev/70a62f108dbbe38cf134 to your computer and use it in GitHub Desktop.
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
<?php | |
// ------------------------------------------------------------------------- | |
/** | |
* Debuguear información sobre una variable o mas en una forma que es legible por humanos. | |
* | |
* Ejemplo: | |
* | |
* Con una sola variable | |
* $this->pr($response); | |
* | |
* Con N variables | |
* $this->pr($request, $response, $log); | |
* | |
* @param mixed | |
* @return void | |
*/ | |
public function pr () | |
{ | |
$numargs = func_num_args(); | |
$arg_list = func_get_args(); | |
$caller = array_shift(debug_backtrace()); | |
echo '<pre><p>DEBUG file: ' . $caller['file'] . ' line:' . $caller['line'] . '</p>'; | |
for ($i = 0; $i < $numargs; $i ++) | |
{ | |
print_r($arg_list[$i]); | |
} | |
echo '</pre>'; | |
} | |
function dd() | |
{ | |
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