Kristian Lunde

www.klunde.net

Writing exceptions in PHP

without comments

Fredrik Johan Holmström has a entry on his blog about writing exceptions in PHP. He points out that several of the large PHP framework assumes that an exception is a fatal error, and that this may be a flaw in the design.

An Exception is not necessarily a fatal error and it should be the responsibility of the code that catches the exception to determine if it is a fatal error or not.

The blog entry got me thinking, and yes I’ve done that mistake a few times myself, I’ll do it right  the next time I write an exception in PHP,

URL: http://loveandtheft.org/2008/05/23/exceptions-youre-doing-it-wrong/

Written by Kristian Lunde

May 24th, 2008 at 11:48 pm

Leave a Reply