As far as I know only a '4-year-old boy' is correct (but 'the boy is four years old'). Perhaps they mean adjectives like 'electromagnetic', which evolved from the compound adjective 'electro-magnetic'.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.