On Thu, Jun 10, 2010 at 2:12 PM, Christian Schneider
<cschn...@cschneid.com>wrote:

> Zeev Suraski wrote:
> > That's exactly what I had in mind.  Have E_TYPE off by default and
> > implement it throughout PHP - instead of just type hints.
> >
> >> for example:
> >> $foo = 0;
> >> $foo += (int)'123abc'; // no error
> >> $foo += '123abc'; // E_TYPE
>
> Out of curiosity: What would you do with the E_TYPE on the last one?
>
> 1) Log it: What for?
> 2) Abort the script: Why?
> 3) Silence it with explicit casting: Why?
> 4) Look at the code and find out X: What is X?
>
>
As for me, I would log it, and depending on the application abort or
continue excetuion, and when I got the report about the error, I would look
at the code...


>
> One biggy for me: E_TYPE should not slow down PHP if one is not
> interested in it. I think there was a discussion about making ignored
> E_* (almost) performance neutral but I don't think that's implemented
> yet, right? We patched away E_NOTICE warnings in the PHP source because
> we're not interested in access to undefined variables and I wouldn't
> want to have to do something similar for E_TYPE.
>
>
The current error handling is "sub-optimal".
AFAIK the error handler gets called and the variables(stack trace) populated
whether the given error matches the error_level, or not.
So I think that thats a different problem.

Tyrael

Reply via email to