I have seen this bit attributed to W.C. Fields, Groucho Marx, and others, but it seems most commonly connected with G. B. Shaw.