From 403dca154c6b539de221f9e16174a0fdd0a1e896 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 5 Feb 2021 23:41:32 +0300 Subject: initial WIP for php8; bump php version requirement to 7.0 --- include/errorhandler.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'include/errorhandler.php') diff --git a/include/errorhandler.php b/include/errorhandler.php index 188c8c5ce..16afcabcf 100644 --- a/include/errorhandler.php +++ b/include/errorhandler.php @@ -10,10 +10,12 @@ function format_backtrace($trace) { if (is_array($e["args"])) { foreach ($e["args"] as $a) { - if (!is_object($a)) { - array_push($fmt_args, $a); - } else { + if (is_object($a)) { array_push($fmt_args, "[" . get_class($a) . "]"); + } else if (is_array($a)) { + array_push($fmt_args, "[" . truncate_string(json_encode($a), 128, "...")) . "]"; + } else { + array_push($fmt_args, $a); } } } @@ -21,7 +23,11 @@ function format_backtrace($trace) { $filename = str_replace(dirname(__DIR__) . "/", "", $e["file"]); $rv .= sprintf("%d. %s(%s): %s(%s)\n", - $idx, $filename, $e["line"], $e["function"], implode(", ", $fmt_args)); + $idx, + $filename, + $e["line"], + $e["function"], + implode(", ", $fmt_args)); $idx++; } -- cgit v1.2.3