xref: /PHP-8.4/ext/dom/tests/gh17201.phpt (revision e2474618)
1--TEST--
2GH-17201 (Dom\TokenList issues with interned string replace)
3--EXTENSIONS--
4dom
5--INI--
6opcache.protect_memory=1
7--FILE--
8<?php
9$dom = DOM\XMLDocument::createFromString('<root class="AA B C"/>');
10$element = $dom->documentElement;
11$list = $element->classList;
12$list->replace('AA', 'AB'); // Use interned string
13foreach ($list as $entry) {
14    var_dump($entry);
15}
16?>
17--EXPECT--
18string(2) "AB"
19string(1) "B"
20string(1) "C"
21