public static function sprint_r($obj)
    {
        ob_start();
        print_r($obj);
        $str = ob_get_contents();
        ob_end_clean();

        $str = preg_replace("/\s+\\(\s+/", " ( ", $str);
        $str = preg_replace("/\n\s+/", ", ", $str);
        $str = preg_replace("/\n\s*\\)/", " )", $str);
        return $str;
    }