But yes, I could write if (count($roles) >= count($roleNames)) { return $roles; }

This way, even in the case where more roles are loaded than asked, it won't throw exception?