diff options
-rw-r--r-- | auto_prepend.php | 4 | ||||
-rw-r--r-- | it_debug.class | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/auto_prepend.php b/auto_prepend.php index 4c6a308..528769f 100644 --- a/auto_prepend.php +++ b/auto_prepend.php @@ -3,7 +3,7 @@ /****************** functions for class it_debug **********************/ /** - * Return string containing names and values of all arguments + * Return string containing names and values of all arguments or stack trace if no args */ function D(...$args) { @@ -11,7 +11,7 @@ function D(...$args) } /** - * Echo string containing names and values of all arguments + * Echo string containing names and values of all arguments or stack trace if no args */ function ED(...$args) { diff --git a/it_debug.class b/it_debug.class index bddd63b..a504be8 100644 --- a/it_debug.class +++ b/it_debug.class @@ -96,6 +96,7 @@ static function dump($args, $p = []) { $p += ['html' => !EDC('edplain') && (self::$force_html || $_SERVER['REMOTE_ADDR']), 'color' => true]; $htmlspecialchars = array("&" => "&", '<' => "<", '>' => ">"); + $args = count($args) ? $args : [it_debug::backtrace(['skiplevels' => 2])]; if ((preg_match('/csv|txt|gif|jpg/', $_SERVER['PHP_SELF']) || preg_grep('#text/(calendar|css|javascript|json|plain|rfc822|xml)|application/#', headers_list()) || $GLOBALS['debug_edplain']) && !$GLOBALS['debug_edhtml']) ; |