We construct new examples on Lavrentiev phenomenon using fractal contact sets. Comparing to the classical examples of Zhikov it is not important that at the saddle point the variable exponent crosses the threshold dimension. As a consequence we give the negative answer to the well-known conjecture that the dimension plays a critical role for the Lavrentiev gap to appear. As an application we present new counterexamples to the density of smooth functions in variable exponent Sobolev spaces and to the regularity of the functional with double-phase potential. The talk is based on joint work with Lars Diening and Mikhail Surnachev.