Skip to content

Improve error and exception handlers #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

nikic
Copy link
Member

@nikic nikic commented Mar 24, 2012

The first commit allows resetting the error handler using set_error_handler(null).

The second commit changes the behavior of both set_error_handler(null) and set_exception_handler(null) to return the previous error/exception handler. This makes the resetting consistent with the normal behavior and addresses the comments by Stas and Pierre.

The third commit cleans up the code a bit.

This is a followup to PR #18 and bug https://bugs.php.net/bug.php?id=60738.

nikic added 3 commits March 24, 2012 14:41
This allows the error handler to be reset using set_error_handler(null).
As the code suggests this behavior was already previously intended, but
the callback check was done too strictly.
set_error_handler(null) and set_exception_handler(null) now return the
previous error/exception handler instead of just returning bool(true).
This is consistent with the behavior of these functions with non-null
values.
@smalyshev
Copy link
Contributor

Definitely needs a note in UPGRADING and NEWS. Otherwise looks fine to me.

@nikic
Copy link
Member Author

nikic commented Apr 4, 2012

@smalyshev Should I add that to the PR? I thought that would not merge well.

And speaking about merging: Do you still think that this is only eligible for master? Quoting my last mail regarding this on internals:

I think both changes should be considered as
bug fixes and as such should also be eligible for 5.3/5.4. The
set_error_handler(null) change has no impact on BC whatsoever and the
return value change only has a theoretical BC impact (why would you
check the return value if it is always true?)

@dsp
Copy link
Member

dsp commented Jun 5, 2012

whats the status on that? Do we get an update version including UPGRADING and NEWS notes?

@php-pulls
Copy link

Comment on behalf of nikic at php.net:

This is now merged, but only for master: a31fa55...5de79f9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants