You dont need the array_key_exists check before empty()