22. They say they were three, the dog being the fourth among them; and they say they were five, the dog being the sixth, guessing at the unseen; and they say they were seven, and the dog being the eighth. Say: "My Lord knows best their number; none knows them but a few.'' So debate not except with the clear proof. And consult not any of them (about the people of the Cave).
Allah tells us that people disputed over the number of the people of the Cave. The Ayah mentions three views, proving that there was no fourth suggestion. Allah indicates that the first two opinions are invalid, by saying,
(guessing at the unseen), meaning that they spoke without knowledge, like a person who aims at an unknown target -- he is hardly likely to hit it, and if he does, it was not on purpose. Then Allah mentions the third opinion, and does not comment on it, or He affirms it by saying,
(and the dog being the eighth.) indicating that this is correct and this is what happened.
(Say: "My Lord knows best their number...'') indicating that the best thing to do in matters like this is to refer knowledge to Allah, because there is no need to indulge in discussing such matters without knowledge. If we are given knowledge of a matter, then we may talk about it, otherwise we should refrain.
(none knows them but a few.) of mankind. Qatadah said that Ibn `Abbas said: "I am one of the few mentioned in this Ayah; they were seven. '' Ibn Jurayj also narrated that `Ata' Al-Khurasani narrated from him, "I am one of those referred to in this Ayah,'' and he would say: "Their number was seven.'' Ibn Jarir recorded that Ibn `Abbas said:
(none knows them but a few.) "I am one of the few, and they were seven.'' The chains of these reports narrated from Ibn `Abbas, which say that they were seven, are Sahih, and this is in accordance with what we have stated above.
(So debate not except with the clear proof.) meaning, gently and politely, for there is not a great deal to be gained from knowing about that.
(And consult not any of them (about the people of the Cave).) meaning, `They do not have any knowledge about it except what they make up, guessing at the unseen; they have no evidence from an infallible source. But Allah has sent you, O Muhammad, with the truth in which there is no doubt or confusion, which is to be given priority over all previous books and sayings.'