On the Lavrentiev phenomenon and the validity of Euler-Lagrange equations for a class of integral functionals.