I was reading the wiki page about paraprosdokians when I come across this sentence.
One morning I shot an elephant in my pajamas, how he got in my pajamas, I don't know.
What is funny about it?
The default interpretation of the first part of the sentence, "I shot an elephant in my pajamas", is that "while I was wearing my pajamas, I shot an elephant." At least 99% of all listeners who hear the sentence will parse it that way.
The humorous part comes from the disconnect generated by the second phrase, wherein the initial default interpretation is turned on its head; rather than "I shot an elephant [while I was] in my pajamas, the speaker forces you to reinterpret it as "I shot an elephant (who was) in my pajamas."
"in my pajamas" -> Inside your pajamas
whereas to avoid ambiguity, one possibility would be:
"wearing my pajamas" -> shot the elephant when you were in your pajamas
Basically the funny thing here is that the elephant is not in your pajamas but the sentence somehow ends up painting that picture. Or so I think...