The above story closely resembles one quoted from the Turkish Tales in the 94th number of the Spectator.
A sultan of Egypt was directed by a great doctor in the law, who had the gift of working miracles, to place himself in a huge tub of water, which he accordingly did; and as he stood by the tub amidst a circle of his great men, the holy man bid him plunge his head into the water and draw it up again. The king accordingly thrust his head into the water, and at the same time found himself at the foot of a mountain on the sea-shore. The king immediately began to rage against his doctor for this piece of treachery and witchcraft; but at length, knowing it was in vain to be angry, he set himself to think on proper methods for getting a livelihood in this strange country. Accordingly he applied himself to some people, whom he saw at work in a neighbouring wood: these people conducted him to a town that stood at a little distance from the wood, where after some adventures, he married a woman of great beauty and fortune. He lived with this woman so long that he had by her seven sons and seven daughters. He was afterwards reduced to great want, and forced to think of plying in the streets as a porter for his livelihood. One day, as he was walking alone by the seaside, being seized with many melancholy reflections upon his former and his present state of life, which had raised a fit of devotion in him, he threw off his clothes in the desire to wash himself, according to the custom of the Muhammadans, before he said his prayers.
After his first plunge into the sea, he no sooner raised his head above the water, than he found himself standing by the side of the tub, with the great men of his court about him, and the holy man at his side. He immediately upbraided his teacher for having sent him on such a course of adventures, and betrayed him into so long a state of misery and servitude; but was wonderfully surprised when he heard that the state he talked of was only a dream and a delusion; that he had not stirred from the place where he then stood; and that he had only dipped his head into the water, and taken it out again. Oesterley compares the story of Devadatta in the 26th Taranga of this work.
[1] Bhanga also means defeat.
[2] This vice was prevalent even in the Vedic age. See Zimmer, Alt-Indisches Leben, pp. 283–287; Muir’s Sanskrit Texts, Vol. V, pp. 425–430. It is well-known that the plot of the Mahábhárata principally turns on this vice.
[3] Compare the conduct of Máthura in the Mrichchhakaṭika. For the penniless state of the gambler, see p. 195, and Gaal, Märchen der Magyaren, p. 3.
[4] I read śakshyámi with the Sanskrit College MS.
[5] Prabodhya should, I think, be prabudhya.