Let H[X] and H[Y ] be abstract Hardy spaces built upon Banach function spaces X and Y over the unit circle T. We prove an analogue of the Brown-Halmos theorem for Toeplitz operators T a acting from H[X]to H[Y ] under the only assumption that the space X is separable and the Riesz projection P is bounded on the space Y . We specify our results to the case of variable Lebesgue spaces X = L p(·) and Y = L q(·) and to the case of Lorentz spaces X = Y = L p,q (w), 1 < p < ∞, 1 ≤ q < ∞ with Muckenhoupt weights w ∈ A p (T).