Ambrose Bierce said this quote

All are lunatics, but he who can analyze his delusion is called a philosopher.