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
Convert E_ERROR to thrown Error in extensions #1942
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trowski
force-pushed
the
throw-error-in-extensions
branch
from
June 13, 2016 14:02
d5313d2
to
771e5cc
Compare
trowski
force-pushed
the
throw-error-in-extensions
branch
from
June 14, 2016 18:18
27a165a
to
7d53864
Compare
Perhaps a good idea to add tests to ensure Throwable and/or Error are caught |
trowski
force-pushed
the
throw-error-in-extensions
branch
3 times, most recently
from
June 18, 2016 14:44
1001fb9
to
7d53864
Compare
@@ -5633,7 +5635,7 @@ ZEND_METHOD(reflection_property, getValue) | |||
return; | |||
} | |||
if (Z_TYPE(CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]) == IS_UNDEF) { | |||
php_error_docref(NULL, E_ERROR, "Internal error: Could not find the property %s::%s", ZSTR_VAL(intern->ce->name), ZSTR_VAL(ref->prop.name)); | |||
zend_throw_error(NULL, "Internal error: Could not find the property %s::%s", ZSTR_VAL(intern->ce->name), ZSTR_VAL(ref->prop.name)); | |||
/* Bails out */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should recover and return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, missed this one.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR converts most occurrences in extensions of
E_ERROR
with thrownError
objects. Not all fatal errors were converted to exceptions. Those dealing with memory allocation or other unrecoverable errors have remained fatal. I also did not covert any fatal errors in the Soap extension. The extension appears to rely heavily on bailout behavior, so fatals could not easily be converted to thrown exceptions. Perhaps someone with more experience with the Soap extension would be able to do so.This PR supersedes #1388.
RFC: https://wiki.php.net/rfc/throw_error_in_extensions