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();
        }
    }
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();
        }
    }
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 ( ) ; } }
Dumps a variable

@param mixed $variable
@param boolean $exit Whether to terminate script execution
@return void
Dumps a variable