Skip to content

Conversation

@nielsdos
Copy link
Member

@nielsdos nielsdos commented Jun 3, 2025

The $classList property is special in the sense that it's a cached object instance per (HTML)Element instance. The reason for this design is because it has the [[SameObject]] IDL attribute. Cloning in PHP also clones the properties, so it also clones the cached instance. To solve this, we undo this by resetting the backing storage.

…ement by clone keyword.

The $classList property is special in the sense that it's a cached
object instance per (HTML)Element instance. The reason for this design
is because it has the [[SameObject]] IDL attribute.
Cloning in PHP also clones the properties, so it also clones the cached
instance. To solve this, we undo this by resetting the backing storage.
@nielsdos nielsdos closed this in 111072a Jun 4, 2025
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.

PHP 8.4 classList works not correctly if copy HTMLElement by clone keyword.

2 participants