Download src/php/php-src/ext/libxml/tests/bug42112.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 631 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/libxml/tests/bug42112.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/libxml/tests/bug42112.phpt
-
curl -L -o bug42112.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/libxml/tests/bug42112.phpt
631 Bytes
| --TEST-- | |
| Bug #42112 (deleting a node produces memory corruption) | |
| --EXTENSIONS-- | |
| dom | |
| --FILE-- | |
| $xml = <<<EOXML | |
| <root><child xml:id="id1">baz</child></root> | |
| EOXML; | |
| function remove_node($doc) { | |
| $node = $doc->getElementById( 'id1' ); | |
| print 'Deleting Node: '.$node->nodeName."\n"; | |
| $node->parentNode->removeChild( $node ); | |
| } | |
| $doc = new DOMDocument(); | |
| $doc->loadXML($xml); | |
| remove_node($doc); | |
| $node = $doc->getElementById( 'id1' ); | |
| if ($node) { | |
| print 'Found Node: '.$node->nodeName."\n"; | |
| } | |
| $root = $doc->documentElement; | |
| print 'Root Node: '.$root->nodeName."\n"; | |
| --EXPECT-- | |
| Deleting Node: child | |
| Root Node: root | |