Skip to content

Conversation

@Girgias
Copy link
Member

@Girgias Girgias commented Apr 5, 2025

The motivation for this is that types should be considered immutable. The only times this is not valid is during compilation, optimizations (opcache), or destruction.

Therefore the "normal" type foreach macros are marked to take const arguments and we add mutable version that say so in the name. Thus add various const qualifiers to communicate intent.

The motivation for this is that types should be considered immutable.
The only times this is not valid is during compilation, optimizations (opcache), or destruction.

Therefore the "normal" type foreach macros are marked to take const arguments and we add mutable version that say so in the name.
Thus add various const qualifiers to communicate intent.
Copy link
Member

@DanielEScherzer DanielEScherzer left a comment

Choose a reason for hiding this comment

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

Okay for ext/reflection

Copy link
Member

@arnaud-lb arnaud-lb left a comment

Choose a reason for hiding this comment

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

This looks good to me!

@Girgias Girgias merged commit 71da944 into php:master Apr 7, 2025
9 checks passed
@Girgias Girgias deleted the foreach-type-const-mutable branch April 7, 2025 11:52
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.

3 participants