$item) { if (is_array($item) && isset($item[0]) && is_string($item[0]) && 2 === count($item)) { if ('object' === $item[0]) { $parts = explode('\\', $item[1]); $short = array_pop($parts); $formattedValue = sprintf('object(%s)', $item[1], $short); } elseif ('array' === $item[0]) { $formattedValue = sprintf('array(%s)', is_array($item[1]) ? $formatArgs($item[1]) : $item[1]); } elseif ('string' === $item[0]) { $formattedValue = sprintf("'%s'", htmlspecialchars($item[1])); } elseif ('null' === $item[0]) { $formattedValue = 'null'; } elseif ('boolean' === $item[0]) { $formattedValue = ''.strtolower(var_export($item[1], true)).''; } elseif ('resource' === $item[0]) { $formattedValue = 'resource'; } else { $formattedValue = str_replace("\n", '', var_export(htmlspecialchars((string) $item[1]), true)); } } elseif (is_object($item)) { $formattedValue = get_class($item); } elseif (is_string($item)) { $formattedValue = ''.htmlspecialchars($item).''; } elseif (is_array($item)) { $formattedValue = sprintf('array(%s)', $formatArgs($item)); } else { $formattedValue = ''; } $result[] = is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue); } return implode(', ', $result); }; echo "
    \n"; $root = realpath(__DIR__.'/../../../../../'); foreach ($traces as $trace) { echo '
  1. '; if (isset($trace['file'])) { $trace['file'] = str_replace($root, '', $trace['file']); echo "{$trace['file']}"; if ($trace['line']) { echo ':'.$trace['line']; } echo ' at '; } if (!empty($trace['function'])) { if (isset($trace['class'])) { echo "{$trace['class']} {$trace['type']} "; } echo " {$trace['function']} ( "; if (!empty($trace['args'])) { echo $formatArgs($trace['args']); } echo ' )'; } echo '
  2. '; } echo "
\n";