Skip to content

Deprecate constant redeclaration #19474

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

Merged

Conversation

alexandre-daubois
Copy link
Member

@alexandre-daubois alexandre-daubois commented Aug 13, 2025

The wording now warns that redeclaring a constant will be an error in PHP 9, instead of a simple warning.

Should we keep the existing message and append to it, or change it to something like "Redeclaring constant %s is deprecated, this will throw an error in PHP 9"? I'm not sure what's the policy with error messages in this repo. I would say that changing the message to something more explicit is better.

RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_constant_redeclaration

Part of #19468, cc @DanielEScherzer

@alexandre-daubois alexandre-daubois force-pushed the constant-redeclaration branch 2 times, most recently from 7ad6db4 to efec085 Compare August 14, 2025 18:40
@DanielEScherzer
Copy link
Member

@alexandre-daubois do you have merge rights? If not I can rebase this when I merge it so that we don't have more merge conflicts

@alexandre-daubois
Copy link
Member Author

I don't, but PR rebased and conflicts resolved 🙂

@DanielEScherzer DanielEScherzer merged commit 010fe2b into php:master Aug 16, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants