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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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

UPGRADING Outdated
@@ -825,6 +825,8 @@ PHP 8.5 UPGRADE NOTES
. The high resolution timer (`hrtime()`) on macOS now uses the recommended
`clock_gettime_nsec_np(CLOCK_UPTIME_RAW)` API instead of
`mach_absolute_time()`.
. Constant redeclaration is deprecated and that behavior will trigger an
Copy link
Member

Choose a reason for hiding this comment

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

please link to the RFC and put this in the deprecation section

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated and moved the NEWS one under the 8.5.0beta2 section

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