public static function findKey($params, $arg, $default = null)
    {
        if (is_object($params) === true)
        {
            $params = (array)$params;
        }

        if (isset($params[$arg]) === true)
        {
            $val = $params[$arg];
            unset($params[$arg]);

            return $val;
        } else
        {
            return $default;
        }
    }