mirror of
https://github.com/php/php-src.git
synced 2025-01-26 21:54:16 +08:00
30 lines
509 B
Plaintext
30 lines
509 B
Plaintext
|
--TEST--
|
||
|
SimpleXML: concatenating attributes
|
||
|
--SKIPIF--
|
||
|
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
|
||
|
--FILE--
|
||
|
<?php
|
||
|
$xml =<<<EOF
|
||
|
<people>
|
||
|
<person name="Foo"></person>
|
||
|
</people>
|
||
|
EOF;
|
||
|
|
||
|
$people = simplexml_load_string($xml);
|
||
|
var_dump($people->person['name']);
|
||
|
$people->person['name'] .= 'Bar';
|
||
|
var_dump($people->person['name']);
|
||
|
|
||
|
?>
|
||
|
===DONE===
|
||
|
--EXPECTF--
|
||
|
object(SimpleXMLElement)#%d (1) {
|
||
|
[0]=>
|
||
|
string(3) "Foo"
|
||
|
}
|
||
|
object(SimpleXMLElement)#%d (1) {
|
||
|
[0]=>
|
||
|
string(6) "FooBar"
|
||
|
}
|
||
|
===DONE===
|