Download src/php/php-src/ext/dom/tests/bug79701/remove_attribute.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 560 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/dom/tests/bug79701/remove_attribute.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/dom/tests/bug79701/remove_attribute.phpt
-
curl -L -o remove_attribute.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/dom/tests/bug79701/remove_attribute.phpt
560 Bytes
| --TEST-- | |
| Bug #79701 (getElementById does not correctly work with duplicate definitions) - remove attribute variation | |
| --EXTENSIONS-- | |
| dom | |
| --FILE-- | |
| $dom = Dom\XMLDocument::createFromString(<<<XML | |
| <root> | |
| <test1 xml:id="x"/> | |
| <test2 xml:id="x"/> | |
| </root> | |
| XML); | |
| var_dump($dom->getElementById('x')?->nodeName); | |
| $dom->getElementById('x')->removeAttribute('xml:id'); | |
| var_dump($dom->getElementById('x')?->nodeName); | |
| --EXPECTF-- | |
| Warning: Dom\XMLDocument::createFromString(): ID x already defined in Entity, line: 3 in %s on line %d | |
| string(5) "test1" | |
| NULL | |