Ferenc Kovacs wrote:
I think it's fine for warnings, notices, and deprecations.
Yeah, continuing the execution and still being to handle/log multiple
notices is something that wouldn't be possible with exceptions.
I think it is a matter of identify where exceptions might be appropriate. On the
whole there is not a problem currently.
>It's well suited to that kind of thing, and for that it should be kept
>(along with completely fatal core errors, where instantiating an object is
>inappropriate or impossible.) And yes, I think there should be exceptions
>in core PHP where appropriate
>
Agree on both cases, but please don't turn this thread into discussing the
viability of turning the php current error handling into exceptions, we
have threads for that.
This thread is about whether or not it is fine for a (new)core feature to
throw exceptions if appropriate.
Once again it's the 'if appropriate' rather than 'if necessary'?
Adding exceptions is another discussion, and I totally agree that in a few areas
then almost anything would be better than the current errors, but simply
returning an exception may not be necessary?
I am feeling that we are getting to a point where there needs to be two
different types of PHP. One that is basically OOP only and does not handle
procedural stuff, and for us old stick in the mud's a procedural base that
handles OO as it has in the past. Generators are an example of something that
when left open and used via the various functions simply makes following easier
than hiding everything away and just working by hidden magic. Exceptions have a
place in the right layer, just as warnings would have if a function was called
at the wrong point. Returning a suitable error number is just as valid as having
to wrap stuff in try statements simply because the function does not actually
handle an error condition? The Error handling brainstorming flagged up that the
reasons for using an exception are not understood, so we need to understand when
they are 'needed' rather then when 'appropriate'?
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php