Fix issue with calling a unique, non-persistent method
[hiphop-php.git] / hphp / test / slow / simple_xml / 1629.php
blob3ef1a0f1b77873756674bc94a34203a0b0af46a5
1 <?php
3 function addChildNode(SimpleXMLElement $parent, SimpleXMLElement $node) {
4 $newchild = $parent->addChild($node->getName(), (string)$node);
5 foreach ($node->attributes() as $name => $value) {
6 $newchild->addAttribute($name, $value);
8 foreach ($node->children() as $child) {
9 addChildNode($newchild, $child);
13 $xmlreq = '<a><item><node><sub>1st</sub><sub>2nd</sub></node></item></a>';
14 $quote = simplexml_load_string($xmlreq);
15 $req = new SimpleXMLElement('<node/>');
16 foreach ($quote->attributes() as $name => $value) {
17 $req->addAttribute($name, $value);
19 foreach ($quote->children() as $child) {
20 addChildNode($req, $child);
23 $vertex = new SimpleXMLElement('<root/>');
24 addChildNode($vertex, $req);
25 var_dump($vertex->asXML());