// Objects that are being dumped static $objects = array(); if (empty($array)) { return "object {$getClass($var)} {}"; } elseif (isset($objects[$hash])) { $output[] = "{\n{$space}{$s}*RECURSION*\n{$space}}"; } elseif ($level < 7) { $output[] = "{"; $objects[$hash] = true; foreach ($array as $key => &$val) { if ($key[0] === "") { $access = $key[1] === "*" ? "protected" : "private"; // Remove the access level from the variable name $key = substr($key, strrpos($key, "") + 1); } else { $access = "public"; } $output[] = "{$space}{$s}{$access} {$key} -> " . kintLite($val, $level + 1); } unset($objects[$hash]); $output[] = "{$space}}"; } else { $output[] = "{\n{$space}{$s}*depth too great*\n{$space}}"; } return "object {$getClass($var)} ({$count($array)}) {$implode("\n", $output)}"; } else { return gettype($var) . htmlspecialchars(var_export($var, true), ENT_NOQUOTES); } } Kint::_init();