Re: [PHP-DEV] Default exception handler

2003-09-07 Thread Sebastian Bergmann
Zeev Suraski wrote: > I don't see any advantage to that at all. The advantage would be to allow for completely different Exception implementations while still beeing able to write a generic catch() handler like catch (Throwable $e) {} (Which does not mean that I think this really use

Re: [PHP-DEV] Default exception handler

2003-09-06 Thread Marcus Börger
Hello Zeev, Saturday, September 6, 2003, 10:52:40 PM, you wrote: > At 20:20 06/09/2003, Sebastian Bergmann wrote: >> * Introduce >> >> interface Throwable {} >> [...] > I don't see any advantage to that at all. Either exceptions inherit from > exception or not, there's no reason to

Re: [PHP-DEV] Default exception handler

2003-09-06 Thread Cristiano Duarte
ZS>I don't see any advantage to that at all. Either exceptions inherit from ZS>exception or not, there's no reason to complicate things with a new ZS>interface. We don't have different kinds of throwables, so doing that ZS>appears to be pure mental overhead. I also failed to understand why ZS>mo

Re: [PHP-DEV] Default exception handler

2003-09-06 Thread Zeev Suraski
At 20:20 06/09/2003, Sebastian Bergmann wrote: Marcus Börger wrote: > If all exception objects must be instances of classes derived from > exception or that class itself..well..why then specify exception. That's why proposed the following a *long* time ago: * Introduce interface Thr

Re: [PHP-DEV] Default exception handler

2003-09-06 Thread Marcus Börger
Hello Sebastian, Saturday, September 6, 2003, 7:20:52 PM, you wrote: > Marcus Börger wrote: >> If all exception objects must be instances of classes derived from >> exception or that class itself..well..why then specify exception. > That's why proposed the following a *long* time ago: > *

Re: [PHP-DEV] Default exception handler

2003-09-06 Thread Sebastian Bergmann
Marcus Börger wrote: If all exception objects must be instances of classes derived from exception or that class itself..well..why then specify exception. That's why proposed the following a *long* time ago: * Introduce interface Throwable {} as built-in interface. * Allow onl

Re: [PHP-DEV] Default exception handler

2003-09-06 Thread Cristiano Duarte
Hi Andi, IMHO I think there should be a way to catch all kinds of exceptions whether they inherits from "Exception" or not. It's specially important in standalone applications like those in PHP-GTK. An external library can throw an unkown exception an it could terminate the program abnormally. Inst

Re: [PHP-DEV] Default exception handler

2003-09-05 Thread Andi Gutmans
Hi Marcus, I implemented this functionality about a year ago (if I'm not mistaken it was part of the original ZE2 tree). The reason we removed it (IIRC) was that we thought it would lead to cleaner PHP code and would force only objects being thrown (although this can be done in other ways). I w

Re: [PHP-DEV] Default exception handler

2003-09-05 Thread Marcus Börger
Hello Marcus, Friday, September 5, 2003, 5:24:21 PM, you wrote: > Hello internals, hi Zeev, hi Andi, > A patch to enable the new syntax can be found here: > http://marcus-boerger.de/php/ext/ze2/ze2-catch-20030905.diff.txt Well, forget about the patch for the moment it doesn't really work :-(

Re: [PHP-DEV] Default exception handler

2003-09-05 Thread Marcus Börger
Hello Shane, Friday, September 5, 2003, 7:23:43 PM, you wrote: > 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-

Re: [PHP-DEV] Default exception handler

2003-09-05 Thread Shane Caraveo
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

Re: [PHP-DEV] Default exception handler

2003-09-05 Thread Sterling Hughes
> > -- > The most effective debugging tool is still careful thought, coupled with > judiciously placed print statements. > - Brian W Kernighan, 1978 The quotes are completely random btw :) -Sterling -- We all agree on the necessity of compromise. We just can't agree on when it's neces

Re: [PHP-DEV] Default exception handler

2003-09-05 Thread Sterling Hughes
On Fri, 2003-09-05 at 17:42, George Schlossnagle wrote: > On Friday, September 5, 2003, at 11:30 AM, Sebastian Bergmann wrote: > > > Marcus Börger wrote: > >> try { > >> // code > >> } > >> catch (class1 $var) { > >> } > >> catch (class2 $var) { > >> } > >> catch ($var) { > >> } > > > > I tho

Re: [PHP-DEV] Default exception handler

2003-09-05 Thread Derick Rethans
On Fri, 5 Sep 2003, George Schlossnagle wrote: > Forcing all thrown objects to be subclassed from Exception does not > feel very PHP-ish. But it was the orginal idea afaik Derick -- "Interpreting what the GPL actually means is a job best left to those that read the future

Re: [PHP-DEV] Default exception handler

2003-09-05 Thread Marcus Börger
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

Re: [PHP-DEV] Default exception handler

2003-09-05 Thread Sebastian Bergmann
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. -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Das Buch zu PHP 5

Re: [PHP-DEV] Default exception handler

2003-09-05 Thread George Schlossnagle
On Friday, September 5, 2003, at 11:30 AM, Sebastian Bergmann wrote: Marcus Börger wrote: try { // code } catch (class1 $var) { } catch (class2 $var) { } catch ($var) { } I thought that only objects of the Exception class and subclasses thereof can be throw(). Forcing all thrown objects to

Re: [PHP-DEV] Default exception handler

2003-09-05 Thread Sebastian Bergmann
Marcus Börger wrote: try { // code } catch (class1 $var) { } catch (class2 $var) { } catch ($var) { } I thought that only objects of the Exception class and subclasses thereof can be throw()n. If that is not the case yet, make it so and try { /* code */ } catch (SomeException $e) {}

[PHP-DEV] Default exception handler

2003-09-05 Thread Marcus Börger
Hello internals, hi Zeev, hi Andi, Currently php doesn't have a default exception handler that gets executed if the thrown excpetion was not caught by any previous handler. I now suggest the following extension: try { // code } catch (class1 $var) { } catch (class2 $var) { } catch ($var) { }