Skip to content

Update Attribute::class constants to PHP 8.5 values - #538

Closed
kubawerlos wants to merge 1 commit into
symfony:1.xfrom
6b7562617765726c6f73:Attribute_php85
Closed

kubawerlos wants to merge 1 commit into
symfony:1.xfrom
6b7562617765726c6f73:Attribute_php85

Conversation

@kubawerlos

Copy link
Copy Markdown

Fixes #537

@DanielEScherzer DanielEScherzer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I had considered sending a patch like this, but decided against it

  • PHP 7.4 code with polyfill: Attribute::TARGET_ALL is 127
  • PHP 8.0-8.4 code: Attribute::TARGET_ALL is 63
  • PHP 8.5: Attribute::TARGET_ALL is 127

Which to me would be confusing. I would expect a PHP 8.0 polyfill to polyfill the class as it existed in PHP 8.0. It is also worth pointing out that for TARGET_CONSTANT, actually trying to put attributes on constants was a parser error until 8.5, so it isn't really useful

@nicolas-grekas

Copy link
Copy Markdown
Member

OK, let me close per @DanielEScherzer's comment.
Another angle is that the new constant cannot be polyfilled on PHP 8.0 to 8.4, so that polyfiling it on 7.4 don't really help - since portable code will need to be cope for those versions anyway.
Thanks to everybody involved.

@kubawerlos
kubawerlos deleted the Attribute_php85 branch August 19, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changes to Attribute::class constants in PHP 8.5

4 participants