Could you add a check here to see whether $class was numeric?

    if (is_numeric($class)) {
        $class = $params;
        $params = array();
    }

That would probably preserve BC