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
1 changed files with 6 additions and 4 deletions

View File

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