Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[ErrorHandler][VarDumper] Remove PHP 8.4 deprecations#57799

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:5.4fromalexandre-daubois:deprecs-8.4
Jul 26, 2024

Conversation

@alexandre-daubois
Copy link
Member

QA
Branch?5.4
Bug fix?no
New feature?no
Deprecations?no
Issues-
LicenseMIT

A new batch of deprecations is coming with PHP 8.4. There's a few things in the code to remove to be completely deprecation free in 5.4. Even if the vote is not finished yet, most deprecations are likely to pass barring a major turn of events.

@alexandre-dauboisalexandre-dauboisforce-pushed thedeprecs-8.4 branch 2 times, most recently from9349347 to99c939aCompareJuly 22, 2024 15:01
'implementation' =>$dom->implementation,
'documentElement' =>newCutStub($dom->documentElement),
'actualEncoding' =>$dom->actualEncoding,
'actualEncoding' =>$dom->encoding,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

what about removing the legacy properties instead? casters don't need to report useless data

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I was not sure about how this could be a breaking change thus this update, but I missed the@internal annotation on the class. Definitely better

@alexandre-daubois
Copy link
MemberAuthor

Again it cannot be changed inExceptionCaster but I think it's OK to keep it like this given that theE_STRICT plain string remains. No chances to forget about it the day it's removed from the codebase.

{
privateconstERROR_CODES = [
\DOM_PHP_ERR =>'DOM_PHP_ERR',
0 =>'DOM_PHP_ERR',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do we need to keep this entry? The way I readthe RFC it will no longer be needed:

PRphp/php-src#11927 got rid of the last use of DOM_PHP_ERR in PHP. It is a non-standard and non-well-defined error code. The last use was for an out-of-memory situation but that's inconsistent as we normally use INVALID_STATE_ERR for that.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

To me, yes. It's targeting 5.4, and we better be careful and just remove deprecation with the minimum possible updates, and without changing any behavior if possible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Well, what I have in mind is adding this entry only in case the used PHP version is before 8.4 (or maybe when the constant is actually defined). Inlining the constant value makes it harder to identify them later when we want to clean up things.

Copy link
MemberAuthor

@alexandre-dauboisalexandre-dauboisJul 23, 2024
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Even with the plain string next to it? It is stored in a constant array and this will require a bit of extra logic everywhere the array constant is called. Still worth it to you?

'actualEncoding' =>$dom->actualEncoding,
'encoding' =>$dom->encoding,
'xmlEncoding' =>$dom->xmlEncoding,
'standalone' =>$dom->standalone,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Where is this change coming from?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

\E_USER_WARNING =>'E_USER_WARNING',
\E_USER_NOTICE =>'E_USER_NOTICE',
\E_STRICT =>'E_STRICT',
2048 =>'E_STRICT',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

should be dependent on the presence of the constant IMO (that way we can more easily identify parts of the code to be cleaned up once support for older PHP versions is going to be dropped)

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think there are few chances to forget it with the plain string next to it. Also, it is stored in a static property in a static class. It also requires extra logic wherever the static property is called, raising chances of introducing a bug if a new usage occurrence of the static property is introduced 😕

@nicolas-grekas
Copy link
Member

Thank you@alexandre-daubois.

@nicolas-grekasnicolas-grekas merged commit989e5f5 intosymfony:5.4Jul 26, 2024
nicolas-grekas added a commit that referenced this pull requestJul 26, 2024
…aubois)This PR was merged into the 7.1 branch.Discussion----------[ErrorHandler] Fix `E_STRICT` logging level| Q             | A| ------------- | ---| Branch?       | 7.1| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        | -| License       | MITFollowing#57799. In more recent branches, E_* errors logging level were raised from warnings to errors.Commits-------390ed6d [ErrorHandler] Fix `E_STRICT` logging level
@fabpotfabpot mentioned this pull requestJul 26, 2024
This was referencedJul 26, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@xabbuhxabbuhxabbuh left review comments

@derrabusderrabusderrabus approved these changes

@ycerutoycerutoAwaiting requested review from ycerutoyceruto is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

5 participants

@alexandre-daubois@nicolas-grekas@derrabus@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp