bug76712.phpt 407 B

1234567891011121314151617181920
  1. --TEST--
  2. BUg #76712 (Assignment of empty string creates extraneous text node)
  3. --EXTENSIONS--
  4. simplexml
  5. --FILE--
  6. <?php
  7. $sxe = new SimpleXMLElement('<foo></foo>');
  8. $sxe->addChild('bar', '');
  9. echo $sxe->asXML();
  10. $sxe = new SimpleXMLElement('<foo></foo>');
  11. $sxe->addChild('bar');
  12. $sxe->bar = '';
  13. echo $sxe->asXML();
  14. ?>
  15. --EXPECT--
  16. <?xml version="1.0"?>
  17. <foo><bar/></foo>
  18. <?xml version="1.0"?>
  19. <foo><bar/></foo>