Array key check before comparison