public static function exportVar($var, $indent = null, $guessTypes = false)
    {
        switch (gettype($var)) {
            case 'string':
                // guess boolean type for "1" and "0"
                if (true === $guessTypes) {
                    if ($var === '0' || $var === '') {
                        return 'false';
                    } elseif ($var === '1') {
                        return 'true';
                    }
                }
                return '\'' . $var . '\'';
            case 'array':
                $indexed = array_keys($var) === range(0, count($var) - 1);
                $row = [];
                foreach ($var as $key => $value) {
                    $row[] = $indent . "\t"
                        . ($indexed ? null : self::exportVar($key, null, $guessTypes) . ' => ')
                        . self::exportVar($value, $indent . "\t", $guessTypes);
                }
                return "[\n" . implode(",\n", $row) . "\n" . $indent . ']';
            case 'boolean':
                return $var ? 'true' : 'false';
            default:
                return var_export($var, true);
        }
    }