Re: Default exception handler

From: Date: Fri, 05 Sep 2003 17:23:43 +0000
Subject: Re: Default exception handler
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-4402@lists.php.net to get a copy of this message
Marcus Börger wrote:
Hello Sebastian, Friday, September 5, 2003, 5:45:13 PM, you wrote:
George Schlossnagle wrote:
Forcing all thrown objects to be subclassed from Exception does not feel very PHP-ish.
In this case I think that right-ish should outweigh PHP-ish.
right-ish...well why not allow to throw integers and strings and....as in other languages then?
Well, couldn't the throw mechanism check to see if the data is something other than an Exception class, and if so, create a new Exception class setting the data into it? try { throw "this is my error"; } catch(Exception $e) { } Shane

« previous php.internals (#4402) next »