Download src/php/php-src/ext/simplexml/tests/016.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/simplexml/tests/016.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/simplexml/tests/016.phpt
-
curl -L -o 016.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/simplexml/tests/016.phpt
1.1 kB
| --TEST-- | |
| SimpleXML: modifying attributes of singular subnode | |
| --EXTENSIONS-- | |
| simplexml | |
| --FILE-- | |
| $xml =<<<EOF | |
| <people> | |
| <person name="Joe"></person> | |
| </people> | |
| EOF; | |
| $people = simplexml_load_string($xml); | |
| var_dump($people->person['name']); | |
| $people->person['name'] = $people->person['name'] . 'Foo'; | |
| var_dump($people->person['name']); | |
| $people->person['name'] .= 'Bar'; | |
| var_dump($people->person['name']); | |
| echo "---[0]---\n"; | |
| $people = simplexml_load_string($xml); | |
| var_dump($people->person[0]['name']); | |
| $people->person[0]['name'] = $people->person[0]['name'] . 'Foo'; | |
| var_dump($people->person[0]['name']); | |
| $people->person[0]['name'] .= 'Bar'; | |
| var_dump($people->person[0]['name']); | |
| --EXPECTF-- | |
| object(SimpleXMLElement)#%d (1) { | |
| [0]=> | |
| string(3) "Joe" | |
| } | |
| object(SimpleXMLElement)#%d (1) { | |
| [0]=> | |
| string(6) "JoeFoo" | |
| } | |
| object(SimpleXMLElement)#%d (1) { | |
| [0]=> | |
| string(9) "JoeFooBar" | |
| } | |
| ---[0]--- | |
| object(SimpleXMLElement)#%d (1) { | |
| [0]=> | |
| string(3) "Joe" | |
| } | |
| object(SimpleXMLElement)#%d (1) { | |
| [0]=> | |
| string(6) "JoeFoo" | |
| } | |
| object(SimpleXMLElement)#%d (1) { | |
| [0]=> | |
| string(9) "JoeFooBar" | |
| } | |