diff --git a/src/DebugBar/DataCollector/ExceptionsCollector.php b/src/DebugBar/DataCollector/ExceptionsCollector.php index 64adcf42..1ca1cfab 100644 --- a/src/DebugBar/DataCollector/ExceptionsCollector.php +++ b/src/DebugBar/DataCollector/ExceptionsCollector.php @@ -97,11 +97,22 @@ public function formatTrace(array $trace) if (isset($track['file'])) { $track['file'] = $this->normalizeFilePath($track['file']); } - return $track; }, $trace); } + // Remove large objects from the trace + $trace = array_map(function ($track) { + if (isset($track['args'])) { + foreach ($track['args'] as $key => $arg) { + if (is_object($arg)) { + $track['args'][$key] = '[object ' . $this->getDataFormatter()->formatClassName($arg) . ']'; + } + } + } + return $track; + }, $trace); + return $trace; }