Skip to content
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

don't log silenced errors in php8 #16313

Merged
merged 1 commit into from Aug 17, 2020
Merged

Conversation

Findus23
Copy link
Member

When testing with PHP 8, I was wondering why I was seeing so many errors in the matomo.log like

WARNING Ecommerce[2020-08-17 15:42:06 UTC] [56b55] /home/lukas/public_html/matomophp8/core/Plugin/Report.php(924): Warning - Undefined array key "items"

that when taking a closer look should be silenced with an @.

$translation = @$translations[$metric];

It turns out that https://github.com/php/php-src/pull/3685 caused a change:

Error handlers that want to only handle non-silenced errors may have to be adjusted. A common pattern I found in our own tests if checks for error_reporting() != 0 to detect silencing. This should be changed to error_reporting() & $err_no to detect whether the specific error type is silenced.

@Findus23 Findus23 added the Needs Review PRs that need a code review label Aug 17, 2020
@Findus23 Findus23 mentioned this pull request Aug 17, 2020
6 tasks
@tsteur
Copy link
Member

tsteur commented Aug 17, 2020

worked for me also still in PHP 7.X. Some UI tests are failing but think this is unrelated.

@tsteur tsteur closed this Aug 17, 2020
@tsteur tsteur reopened this Aug 17, 2020
@tsteur tsteur merged commit b5dd5fb into 4.x-dev Aug 17, 2020
@tsteur tsteur deleted the dont-log-silenced-errors-in-php8 branch August 17, 2020 20:53
@mattab mattab added this to the 4.0.0 milestone Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants