bug37076_1.phpt 400 B

123456789101112131415161718192021
  1. --TEST--
  2. Bug #37076 (SimpleXML ignores .=) (appending to unnamed attribute)
  3. --EXTENSIONS--
  4. simplexml
  5. --FILE--
  6. <?php
  7. $xml = simplexml_load_string("<root><foo /></root>");
  8. try {
  9. $xml->{""} .= "bar";
  10. } catch (ValueError $exception) {
  11. echo $exception->getMessage() . "\n";
  12. }
  13. print $xml->asXML();
  14. ?>
  15. --EXPECT--
  16. Cannot create element with an empty name
  17. <?xml version="1.0"?>
  18. <root><foo/></root>