5 each of the two men—the cupbearer and the baker of the king of Egypt, who were being held in prison—had a dream the same night, and each dream had a meaning of its own.

Read Genesis 40:5 Using Other Translations

And they dreamed a dream both of them, each man his dream in one night, each man according to the interpretation of his dream, the butler and the baker of the king of Egypt, which were bound in the prison.
And one night they both dreamed--the cupbearer and the baker of the king of Egypt, who were confined in the prison--each his own dream, and each dream with its own interpretation.
While they were in prison, Pharaoh’s cup-bearer and baker each had a dream one night, and each dream had its own meaning.