Re: [path] fixing errors, take 2
| From: | Hannes Magnússon | Date: | Sun, 19 Dec 2010 09:13:55 +0000 |
| Subject: | Re: [path] fixing errors, take 2 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-51083@lists.php.net to get a copy of this message | ||
On Sun, Dec 19, 2010 at 04:31, Stas Malyshev <smalyshev@sugarcrm.com> wrote:
> Hi!
>
> Since my first attempt to make error reporting in PHP more efficient (see
> epic thread here:
>
> http://www.pubbs.net/200908/php/49633-php-dev-patch-error-masks.html)
> I
> thought about another approach to fixing it.
> This approach eliminates the need for additional .ini setting and shortcuts
> only those errors that would not have any consequences - i.e. would not be
> displayed, logged, stored, converted to exception or otherwise have any
> effect on the outside world. The benefit of this approach is obvious -
> nothing changes for the user, only the code runs faster. The cost is that we
> add one handler to utility_functions and thus code that overrides error
> callback (debuggers, etc.) would have to provide their own handler if they
> want the same functionality (by default if this handler detects somebody
> stole error callback it turns off).
> The patch is attached.
> Any objections for trunk?
AFAICT from the patch..
if (@strpos()) {} else { var_dump(error_get_last()); }
will give you the last error that happened before strpos()?
-Hannes