Hello Adam,

Tuesday, April 13, 2004, 11:15:11 PM, you wrote:

> On Tue, 13 Apr 2004, Marcus Boerger wrote:

>> > In PHP 4, E_ERROR is fatal. In PHP 5, E_ERROR is (currently) also
>> > fatal. This always happens regardless of any exception handling.
>>
>> > With exceptions, we have the ability to modify E_ERRORs to be
>> > non-fatal.
>>
>> Not at the moment.

> Ah. Okay. I guess I was confused by:

>> 1) convert the non continuable E_ERRORs to a higher severity (if there
>>   are any at all)

> So what you're saying is that some problems that are classified (by a
> developer) as E_ERRORs aren't actually fatal to PHP even though right
> now PHP treats them as such. (Like an E_ERROR for passing the wrong
> number of parameters to a function.)

Your example is interesting. It shows an error that would be continuable
from an engine's point of view but not from the script's point of view. It
shows that there should not be any possibility to recover from exceptions
at the exact spot where the exception was thrown - anyway somthing that
violates the general exception idea (see Stanislav's mail on local stack
corruption...).

> But, since these problems are probably still "very bad," they're the
> type of errors that are best handled by exceptions.

After having all E_ERRORs theoretical recoverable there might be places
where exceptions are better than actual E_ERRORs.

> Therefore, you propose to promote non-recoverable errors to E_FATAL
> (or whatever) and keep the recoverable E_ERRORs where they are.

Exact so far.

> Then,
> when an E_ERROR occurs, it's thrown as an exception? (I'm not sure if
> you're saying this.)

Only where needed (e.g. the extension developer wants to). For me 'where
needed) includes ctor failure as mentioned before - SQLite does so.

> If the developer catches it, they handle it. If they don't, PHP
> catches it and issues a fatal error.

I am not a friend of PHP catching exceptions and converting them to
E_ERRORs. Just have an uncaught exception message as we have now.
And no way of generous catching E_ERRORs by back-door.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to