ErrorHandling: improve argument handling for debug info

`var_dump` was the wrong function to call for objects, as it would just output all object
data to the output buffer... Let's generalise and use `var_export` instead :-)
This commit is contained in:
Aaron van Geffen 2023-03-28 19:21:07 +02:00
parent 6c5d814a99
commit 2a528f2830

View File

@ -100,10 +100,12 @@ class ErrorHandler
{ {
foreach ($call['args'] as $j => $arg) foreach ($call['args'] as $j => $arg)
{ {
if (is_array($arg)) // Only include the class name for objects
$args[$j] = print_r($arg, true); if (is_object($arg))
elseif (is_object($arg)) $args[$j] = get_class($arg) . '{}';
$args[$j] = var_dump($arg); // Export everything else -- including arrays
else
$args[$j] = var_export($arg, true);
} }
} }