-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Correctly skip suppressed errors in PHP 8.0 #27631
Correctly skip suppressed errors in PHP 8.0 #27631
Conversation
As a side note: other
|
cc @skjnldsv, @eneiluj, @icewind1991 and @ArtificialOwl for feedback on this |
Hmm I'm not sure if I understand the failed test. Drone CI [1] reports that "And I see that the new user form is shown" failed, while the new user form seems fine with my patched installation. |
After rebasing onto the latest git-master, the |
Tested on NC 22 and looks good. |
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.
Makes sense 👍
Not sure if this is important:
|
Checking again, the failure in |
Hmm, how can I proceed here? GitHub refuses to merge this PR as some tests failed. Also, could this be backported to versions that declare PHP 8 support (stable-22 and stable-21)? |
This comment has been minimized.
This comment has been minimized.
Can you rebase to master please @yan12125 ? |
Done! Previous failures are green this time, but there is a new failure, and it is not mentioned in #22305
|
That's okay and unrelated I think |
Thanks! But GitHub still insists on green for all tests 😂 |
Applies the suggested transformation mentioned in https://www.php.net/manual/en/migration80.incompatible.php, > The @ operator will no longer silence fatal errors (E_ERROR, > E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR, > E_PARSE). Error handlers that expect error_reporting to be 0 when > @ is used, should be adjusted to use a mask check instead The new code still works on PHP 7, as error_reporting() already returns 0 when diagnostics are suppressed. This fixes #25807 in PHP 8.0. For PHP 7.x, #22243 suppresses the E_NOTICE message from the second session_start() call with the error suppression operator @, and thus those E_NOTICE messages are still logged in PHP 8.0. See also #25806 Signed-off-by: Chih-Hsuan Yen <yan12125@gmail.com>
/backport to stable22 |
/backport to stable21 |
The backport to stable21 failed. Please do this backport manually. |
The backport to stable22 failed. Please do this backport manually. |
Looks good :) Thanks for already taking care of that 👍 |
Hmm is this needed on stable20? The latter does not declare support for PHP 8.0 [1]. I guess it will not bring errors, though. [1] https://github.com/nextcloud/server/blob/stable20/lib/versioncheck.php |
Ah that is true, if fails even when overriding the check, due to broader incompatibility. The bot is sleeping anyway 😄. |
Applies the suggested transformation mentioned in
https://www.php.net/manual/en/migration80.incompatible.php,
The new code still works on PHP 7, as error_reporting() already
returns 0 when diagnostics are suppressed.
This fixes #25807 in PHP 8.0.
For PHP 7.x, #22243 suppresses
the E_NOTICE message from the second session_start() call with the error
suppression operator @, and thus those E_NOTICE messages are still
logged in PHP 8.0.
See also #25806
Signed-off-by: Chih-Hsuan Yen yan12125@gmail.com