Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] [path] fixing errors, take 2 [RSS Feed]

#1 Dec. 19, 2010 09:14:40

Hannes M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] [path] fixing errors, take 2


On Sun, Dec 19, 2010 at 04:31, Stas Malyshev <smalys***@*ugarcrm.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

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

Offline

#2 Dec. 19, 2010 09:57:37

Stas M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] [path] fixing errors, take 2


Hi!AFAICT from the patch..
if (@strpos()) {} else { var_dump(error_get_last()); }
will give you the last error that happened before strpos()?Hmm... that unfortunately depends on ignore_repeated_errors, I didn'tsee this use case. With error_get_last() we probably can't fix it sinceit requires storing full error message for every error. That kind ofsucks :(--
Stanislav Malyshev, Software Architect
SugarCRM:http://www.sugarcrm.com/(408)454-6900 ext. 227

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

Offline

#3 Dec. 19, 2010 10:03:57

Hannes M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] [path] fixing errors, take 2


On Sun, Dec 19, 2010 at 10:56, Stas Malyshev <smalys***@*ugarcrm.com> wrote:
> Hi!
>
>> AFAICT from the patch..
>> if (@strpos()) {} else { var_dump(error_get_last()); }
>> will give you the last error that happened before strpos()?
>
> Hmm... that unfortunately depends on ignore_repeated_errors, I didn't see
> this use case. With error_get_last() we probably can't fix it since it
> requires storing full error message for every error. That kind of sucks :(

I like the idea behind the patch, and I cannot think of a clean way
around the error_get_last() problem.
error_get_last() also has issues with user defined error handler, so I
suppose we should just document it properly..

-Hannes

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

Offline

  • Root
  • » PHP
  • » [PHP-DEV] [path] fixing errors, take 2 [RSS Feed]

Board footer

Moderator control

Enjoy the 16th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support