xref: /PHP-8.1/ext/simplexml/tests/016a.phpt (revision 7f2f0c00)
1--TEST--
2SimpleXML: concatenating attributes
3--EXTENSIONS--
4simplexml
5--FILE--
6<?php
7$xml =<<<EOF
8<people>
9   <person name="Foo"></person>
10</people>
11EOF;
12
13$people = simplexml_load_string($xml);
14var_dump($people->person['name']);
15$people->person['name'] .= 'Bar';
16var_dump($people->person['name']);
17
18?>
19--EXPECTF--
20object(SimpleXMLElement)#%d (1) {
21  [0]=>
22  string(3) "Foo"
23}
24object(SimpleXMLElement)#%d (1) {
25  [0]=>
26  string(6) "FooBar"
27}
28