public static function dump($variable, $exit = true)
    {
        if (is_object($variable) && method_exists($variable, '__toString')) {
            echo $variable;
        } else {
            if (is_bool($variable)) {
                var_dump($variable);
            } else {

                $text = sprintf('<pre>%s</pre>', print_r($variable, true));
                print $text;
            }
        }

        if ($exit === true) {
            exit();
        }
    }