Download src/php/php-src/ext/dom/tests/DOMComment_replaceData_basic.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 668 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/dom/tests/DOMComment_replaceData_basic.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/dom/tests/DOMComment_replaceData_basic.phpt
-
curl -L -o DOMComment_replaceData_basic.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/dom/tests/DOMComment_replaceData_basic.phpt
668 Bytes
| --TEST-- | |
| Test replacing data into a DOMComment basic test | |
| --CREDITS-- | |
| Andrew Larssen <al@larssen.org> | |
| London TestFest 2008 | |
| --EXTENSIONS-- | |
| dom | |
| --FILE-- | |
| $dom = new DomDocument(); | |
| $comment = $dom->createComment('test-comment'); | |
| $comment->replaceData(4,1,'replaced'); | |
| $dom->appendChild($comment); | |
| echo $dom->saveXML(); | |
| // Replaces rest of string if count is greater than length of existing string | |
| $dom = new DomDocument(); | |
| $comment = $dom->createComment('test-comment'); | |
| $comment->replaceData(0,50,'replaced'); | |
| $dom->appendChild($comment); | |
| echo $dom->saveXML(); | |
| --EXPECT-- | |
| xml version="1.0" | |
| <!--testreplacedcomment--> | |
| xml version="1.0" | |
| <!--replaced--> | |