Skip to content

Conversation

@lacatoire
Copy link
Contributor

@lacatoire lacatoire commented Dec 23, 2025

Issue 4600 The documentation for ReflectionClass::setStaticPropertyValue() is outdated.

Since PHP 7.4.9, this method can set static properties regardless of their visibility (public, protected, or private), which is covered by core tests. The current description still states that private and protected properties would fail.

This PR updates:

  • the short description and refpurpose,
  • removes the outdated visibility limitation,
  • and adds a changelog entry for PHP 7.4.9 while keeping the historical 7.4.0 note.

@lacatoire lacatoire force-pushed the reflection/setstaticpropertyvalue-doc branch from 0a87feb to a6b09b8 Compare December 23, 2025 13:52
<methodname>ReflectionProperty::setValue</methodname> allows setting
the value of public, private, and protected properties.
<methodname>ReflectionProperty::setValue</methodname> can also be
used to set the value of static properties.allows setting.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
used to set the value of static properties.allows setting.
used to set the value of static properties.

looks like this was left over

</entry>
</row>
<row>
<entry>7.4.9</entry>
Copy link
Member

Choose a reason for hiding this comment

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

there should also be documentation of which minor (non-patch) version of PHP this was first changed in, e.g. it could be that 7.4.9 was released after 8.0.0 and thus PHP 8.0 only allows public static properties, or that 7.4.9 was before 8.0.0 and the change was also in 8.0.0, but without further detail a reader would need to investigate

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.

2 participants