Allah the Exalted says, “So he remained in prison for a few years,” and He also says, “within a few years” (al-Rūm 4). This latter verse is a rebuttal of his claim.
Al-Farrāʾ states: One may say biḍʿata ʿashar (“a few-teen”) and biḍʿa wa-ʿishrūn (“a few-and-twenty”) up to ninety, but it is not said “a few and a hundred” or “a few and a thousand.” Al-Jawharī differed regarding numbers beyond “a few-teen,” maintaining that one should not say “a few-and-twenty” up to ninety.
In the Ṣaḥīḥ it is recorded: “Faith is sixty-odd branches.” In another wording: “and seventy branches; the highest of them is to say ‘There is no god but Allah,’ and the lowest is to remove something harmful from the road.” (1)
Those who claim that the pronoun in the verse, “So Satan caused him to forget the remembrance of his lord,” refers to Joseph have had their view judged weak, even though it is related from Ibn ʿAbbās and ʿIkrimah. The report transmitted by Ibn Jarīr (2) on this point is weak from every angle; its chain is unique to Ibrāhīm ibn Yazīd al-Khūzī al-Makkī, who is deemed unreliable. Likewise, the mursal reports of al-Ḥasan and Qatādah are not acceptable—especially here. Allah knows best.
As for what Ibn Ḥibbān cites in his Ṣaḥīḥ (3) concerning the reason Joseph stayed in prison as long as he did—he narrated: “Al-Faḍl ibn al-Ḥabbāb al-Jumaḥī informed us, Musaddad ibn Musarhad narrated to us, Khālid ibn ʿAbd Allāh narrated to us, Muḥammad ibn ʿAmr narrated to us, from Abū Salamah, from Abū Hurayrah, who said: The Messenger of Allah (ﷺ) said, ‘May Allah have mercy on Joseph! Had it not been for the word he uttered—“Mention me in the presence of your lord”—he would not have remained in prison as long as he did. And may Allah have mercy on Lot; he would indeed have taken refuge in a Mighty Support, as he said to his people, “If only I had strength against you, or could take refuge in a mighty support” (Hūd 80). From then on Allah never sent a prophet except that he possessed strength among his people.’” This ḥadīth is classified as munkar along this route. Muḥammad ibn ʿAmr ibn ʿAlqamah is known for solitary reports that contain oddities, and this wording is among the most objectionable. What is firmly established in the two Ṣaḥīḥs (4) demonstrates its error. Allah knows best.
“And the king said, ‘I have seen in a dream seven fat cows being devoured by seven lean ones, and seven green ears of grain and others dry. O nobles, explain to me my vision, if you can interpret dreams.’ (43)
They said, ‘A jumble of nightmares, and we have no knowledge of interpreting dreams.’ (44)
Then the one of the two who had been saved remembered after some time and said, ‘I will inform you of its interpretation; so send me forth.’ (45)
[He came and said,] ‘Joseph, truthful man, explain to us concerning seven fat cows that seven lean ones devour, and seven green ears of grain and others dry, so that I may return to the people; perhaps they will know.’ (46)
He said, ‘You will sow for seven consecutive years without letup; whatever you harvest, leave it in its ear, except for a little that you eat. (47) Then after that will come seven hard years that will consume what you have stored up for them, except a little of what you preserve. (48) Then there will come …’