Skip to content
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

Fix some PHP 8.2 deprecations #319

Merged
merged 7 commits into from
Jun 10, 2022
Merged

Fix some PHP 8.2 deprecations #319

merged 7 commits into from
Jun 10, 2022

Conversation

TimWolla
Copy link
Contributor

@TimWolla TimWolla commented Jun 10, 2022

PHP 8.2 deprecates the creation of dynamic properties on objects: https://wiki.php.net/rfc/deprecate_dynamic_properties. This pull request fixes some of the low-hanging fruit of properties that are dynamically created.

I've opted to use the public access modifier, as this most closely matches the previous behavior: Dynamically created properties are visible from everywhere. The only non-trivial – and possibly breaking – change is happening in RemoveSpansWithoutAttributes as that one does not add a dynamic property to itself, but to another object instead.

This pull request does not fix all deprecations, a follow up change will be required to fix the remainder.

TimWolla added 7 commits June 10, 2022 10:43
This fixes a PHP 8.2 deprecation.
Previously the undefined property `->markForDeletion` was added to the incoming
tokens. This causes a deprecation in PHP 8.2. Fix this by storing to-be-deleted
tokens inside SplObjectStorage. In PHP 8 a WeakMap would be preferable, as that
prevents leaks if `handleEnd` is never called for the token.
@ezyang ezyang merged commit 1db36fb into ezyang:master Jun 10, 2022
@TimWolla TimWolla deleted the php8.2 branch August 30, 2022 07: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.

2 participants