[php-src] Issue #18744: PHP 8.4 classList works not correctly if HTMLElement cloned.

From: Date: Tue, 03 Jun 2025 13:37:16 +0000
Subject: [php-src] Issue #18744: PHP 8.4 classList works not correctly if HTMLElement cloned.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-250198@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/18744 Author: asika32764 ### Description The following code: ```php <?php $doc = \Dom\HTMLDocument::createEmpty(); $ele1 = $doc->createElement('div'); $ele1->classList->add('foo'); $ele2 = clone $ele1; $ele2->classList->add('bar'); echo "Element1 class: " . $ele1->getAttribute('class'); echo "\n"; echo "Element1 class: " . $ele2->getAttribute('class'); ``` Resulted in this output: ``` Element1 class: foo bar Element1 class: foo ``` But I expected this output instead: ``` Element1 class: foo Element1 class: foo bar ``` ### PHP Version ```plain PHP 8.4.7 (cli) (built: May 6 2025 14:14:22) (NTS Visual C++ 2022 x64) Copyright (c) The PHP Group Zend Engine v4.4.7, Copyright (c) Zend Technologie ``` ### Operating System Windows 111

« previous php.bugs (#250198) next »