obhd encapsulated debug print

This commit is contained in:
fbsanchez 2019-09-03 12:40:16 +02:00
parent 5c535514e1
commit 291dece854
1 changed files with 17 additions and 0 deletions

View File

@ -98,6 +98,23 @@ function hd($var, $file='', $oneline=false)
}
/**
* Encapsulation (ob) for debug print function.
*
* @param mixed $var Variable to be dumped.
* @param string $file Target file path.
* @param boolean $oneline Show in oneline.
*
* @return string Dump string.
*/
function obhd($var, $file='', $oneline=false)
{
ob_start();
hd($var, $file, $oneline);
return ob_get_clean();
}
function debug()
{
$args_num = func_num_args();