static function array2object(array $arr, $class = 'StdClass')
    {
        $obj = new $class;
        foreach ($arr as $key => $value) {
            $obj->{$key} = is_array($value) ? static::array2object($value, $class) : $value;
        }
        return $obj;
    }