/** * Builds the context vars list for display * @var array $vars an array of vars to output * @var int $level the level in the context vars (prevent infinite recursion) * @return string the output to display */ function buildVarList($vars, $level = 0) { $output = ''; $indent = str_repeat(' ', 6 + $level * 2); $prefix = $level == 0 ? '$' : '\''; $suffix = $level == 0 ? '' : '\''; foreach ($vars as $key => $value) { if ($level == 0) { $key = $prefix . $key; } elseif (!is_numeric($key)) { $key = $prefix . $key . $suffix; } if (is_array($value)) { $length = count($value); $output .= '<li class="close">' . "\n" . $indent; $output .= ' <b class="toggle"></b>' . "\n" . $indent; $output .= ' <span><b>' . $key . ':</b> array(' . $length . ')</span>' . "\n" . $indent; $output .= ' <ul>' . "\n" . $indent; if ($level > 5) { // Prevent infinite recursion $output .= ' <li><span><em>(too much levels)</em></span></li>' . "\n" . $indent; } elseif ($length > 0) { $output .= ' ' . buildVarList($value, $level + 1) . "\n" . $indent; } else { $output .= ' <li><span><em>(empty)</em></span></li>' . "\n" . $indent; } $output .= ' </ul>' . "\n" . $indent; $output .= '</li>' . "\n" . $indent; } else { $output .= '<li><span><b>' . $key . ':</b> ' . describeVar($value) . '</span></li>' . "\n" . $indent; } } return rtrim($output); }
?> </li> <li class="icon-pin-small"><b>Line:</b> <?php echo $errline; ?> </li> </ul> <ul class="collapsible-list with-bg"> <li class="close"> <b class="toggle"></b> <span><b>Context:</b></span> <ul class="with-icon no-toggle-icon"> <?php if (is_array($errcontext) and count($errcontext) > 0) { echo buildVarList($errcontext); } else { echo '<li><span><em>(empty)</em></span></li>'; } // Preserve indentation echo "\n"; ?> </ul> </li> </ul> <h2>Stack backtrace</h2> <?php if (count($stackDesc) > 0) { echo implode("\n" . ' ', $stackDesc); } else {