public static function toHtml($var, array $options = null): string
    {
        $options += [
            self::DEPTH => 4,
            self::TRUNCATE => 150,
            self::COLLAPSE => 14,
            self::COLLAPSE_COUNT => 7,
            self::OBJECT_EXPORTERS => null,
            self::DEBUGINFO => false,
            self::KEYS_TO_HIDE => [],
        ];
        $loc = &$options[self::LOCATION];
        $loc = $loc === true ? ~0 : (int) $loc;

        $options[self::KEYS_TO_HIDE] = \array_flip(\array_map('\\strtolower', $options[self::KEYS_TO_HIDE]));
        $options[self::OBJECT_EXPORTERS] = (array) $options[self::OBJECT_EXPORTERS] + self::$objectExporters;
        \uksort($options[self::OBJECT_EXPORTERS], function ($a, $b): int {
            return $b === '' || (\class_exists($a, false) && \is_subclass_of($a, $b)) ? -1 : 1;
        });

        $live = !empty($options[self::LIVE]) && $var && (\is_array($var) || \is_object($var) || \is_resource($var));
        [$file, $line, $code] = $loc ? self::findLocation() : null;
        $locAttrs = $file && $loc & self::LOCATION_SOURCE ? Helpers::formatHtml(
            ' title="%in file % on line %" data-tracy-href="%"', "$code\n", $file, $line,
            Helpers::editorUri($file, $line)
        ) : null;

        return '<pre class="tracy-dump' . ($live && $options[self::COLLAPSE] === true ? ' tracy-collapsed' : '') . '"'
            . $locAttrs
            . ($live ? " data-tracy-dump='" . \json_encode(self::toJson($var, $options),
                    JSON_HEX_APOS | JSON_HEX_AMP) . "'>" : '>')
            . ($live ? '' : self::dumpVar($var, $options))
            . ($file && $loc & self::LOCATION_LINK ? '<small>in ' . Helpers::editorLink($file, $line) . '</small>' : '')
            . "</pre>\n";
    }