-->
Lit., "entered the prison with him". According to the Biblical account (not contradicted by the Qur'an), they were the King's cup-bearer and baker, both of them imprisoned for unspecified offences.
This is the meaning given by Baghawi, Zamakhshari and Baydawi to the expression al-muhsinin in the above context, adopting the tropical use of the verb ahsana in the sense of "he knew [something]" or "he knew [it] well". Thus, the Qur'an indicates here in its elliptic manner that Joseph's reputation for wisdom and dream-interpretation preceded him to prison.
Now opens another chapter in Joseph's life. The Plan of Allah develops. The wicked might plot; the weak might be swayed by specious arguments; but everything is used by the Universal Plan for its own beneficent purposes. Joseph must get into touch with the Pharaoh, in order to work out the salvation of Egypt, and yet it must be through no obligation to smaller men. And he must diffuse his personality and teach the truth to men of all sorts in prison.
Two men came to the prison about the same time as Joseph. They were both apparently officers of the king (the Pharaoh), who had incurred his wrath. One was a cup-bearer (or butler or chief steward) whose duty was to prepare the king's wines and drinks. The other was the king's baker, whose duty was to prepare the king's bread. They were both in disgrace. The former dreamed that he was again carrying on his duties and pressing wine; the latter that he was carrying bread, but it did not reach his master, for the birds ate of it.
Both these men saw the Signs of Allah about Joseph. They felt not only that he had wisdom, but that he was kind and benevolent, and would give of his wisdom even to strangers like themselves. They therefore told him their dreams and asked him to interpret them.