-
Notifications
You must be signed in to change notification settings - Fork 63
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
fix(agent): Fixes newrelic_notice_error() API for PHP 8+ #960
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
|
PHP 8+ only pass 4 parameters instead of 5 to a handler configured with set_error_handler(). Since newrelic_notice_error() can be used as an error handler it needs to accept this form as well.
It is now valid to pass 4 arguments to newrelic_notice_error() so it was necessary to modify the test case.
mfulb
force-pushed
the
fix/notice-error-api-php8
branch
from
September 10, 2024 17:50
54ea2a5
to
f31d18f
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #960 +/- ##
==========================================
+ Coverage 78.32% 78.35% +0.02%
==========================================
Files 194 194
Lines 26880 26879 -1
==========================================
+ Hits 21055 21061 +6
+ Misses 5825 5818 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
zsistla
reviewed
Sep 11, 2024
zsistla
reviewed
Sep 11, 2024
Co-authored-by: Amber Sistla <[email protected]>
hahuja2
previously approved these changes
Sep 17, 2024
bduranleau-nr
previously approved these changes
Sep 18, 2024
bduranleau-nr
previously approved these changes
Sep 18, 2024
hahuja2
reviewed
Sep 18, 2024
hahuja2
previously approved these changes
Sep 18, 2024
Co-authored-by: Hitesh Ahuja <[email protected]>
hahuja2
approved these changes
Sep 18, 2024
zsistla
approved these changes
Sep 18, 2024
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.
Starting with PHP 8.0 the
set_error_handler()
callback function signature drops the$errcontext
final parameter so it only contains 4 parameters. This caused usingnewrelic_notice_error()
as a callback handler for PHP 8+ to not work as the API call did not accept only 4 arguments. This PR adds support for this function signature. There are also numerous tests added that will hopefully caught this kind of issue in the future.