Exception handler written in PHP