Skip to content

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented May 27, 2023

Unsetting a property leaves a property in a different PHP internal state then (re)setting it to an empty value.

Most notably, an unset property triggers the magic __set()/__get() etc methods if available, and while this abstract doesn't declare those methods, a sniff implementing the abstract may.

This change maintains the target behaviour (resetting the property values to save memory), while preventing side-effects from using unset() on these properties.

Unsetting a property leaves a property in a different PHP internal state then (re)setting it to an empty value.

Most notably, an unset property triggers the magic `__set()`/`__get()` etc methods if available, and while this abstract doesn't declare those methods, a sniff implementing the abstract _may_.

This change maintains the target behaviour (resetting the property values to save memory), while preventing side-effects from using `unset()` on these properties.
@jrfnl jrfnl added this to the 1.0.6 milestone May 27, 2023
@jrfnl jrfnl merged commit 2b06f54 into develop May 27, 2023
@jrfnl jrfnl deleted the feature/abstractarraydeclaration-minor-tweak branch May 27, 2023 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant