An alternative type of approximation for the exchange and correlation functional in density functional theory is proposed. This approximation depends on a variable $u$ that is able to detect inhomogeneities in the electron density $rho$ without using derivatives of $rho$. Instead, $u$ depends on the orbital energies which can also be used to measure how a system differs from the homogeneous electron gas. Starting from the functional of Perdew, Burke, and Ernzerhof (PBE) [Phys. Rev. Lett. 77, 3865 (1996)], a functional depending on $u$ is constructed. Tests on the lattice constant, bulk modulus, and cohesive energy of solids show that this $u$-dependent PBE-like functional is on average as accurate as the original PBE or its solid-state version PBEsol. Since $u$ carries more nonlocality than the reduced density gradient $s$ used in functionals of the generalized gradient approximation (GGA) like PBE and $alpha$ used in meta-GGAs, it will be certainly useful for the future development of more accurate exchange-correlation functionals.